mirror of
git://soft.sys114.com/klipper
synced 2026-02-12 00:00:27 +09:00
Compare commits
14 Commits
master
...
cc327ad429
| Author | SHA1 | Date | |
|---|---|---|---|
| cc327ad429 | |||
| 9872a71563 | |||
| 70b845cb00 | |||
| 494735229a | |||
| 3acafffb69 | |||
| 5f5e89fe50 | |||
| 15b2bc24ea | |||
| 8d4cd86cfe | |||
| 3f2d69c139 | |||
| 182478397b | |||
| ee34c1d308 | |||
| 4d953dd19a | |||
|
|
f7d08a02bb | ||
| c773418da6 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -4,3 +4,7 @@ out
|
|||||||
.config
|
.config
|
||||||
.config.old
|
.config.old
|
||||||
klippy/.version
|
klippy/.version
|
||||||
|
|
||||||
|
.pybuild/
|
||||||
|
dist
|
||||||
|
firmware
|
||||||
|
|||||||
5
80-can.network
Normal file
5
80-can.network
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[Match]
|
||||||
|
Name=can0
|
||||||
|
|
||||||
|
[CAN]
|
||||||
|
BitRate=1000000
|
||||||
261
config/example-odroidc5.cfg
Normal file
261
config/example-odroidc5.cfg
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
# Copyright (C) 2025 Hardkernel Co., Ltd
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
# This file contains common pin mappings for the m1s with board_stepper
|
||||||
|
# To use this config, the firmware should be compiled for the
|
||||||
|
# Linux process.
|
||||||
|
|
||||||
|
[mcu]
|
||||||
|
serial: /tmp/klipper_host_mcu
|
||||||
|
|
||||||
|
[mcu EBBCan] # based on EBB42 CAN V1.0
|
||||||
|
canbus_uuid: 1e8ea3b32c8a
|
||||||
|
|
||||||
|
[printer]
|
||||||
|
kinematics: cartesian
|
||||||
|
max_velocity: 500
|
||||||
|
max_accel: 5000
|
||||||
|
#max_accel: 7000
|
||||||
|
#max_accel_to_decel: 3500
|
||||||
|
max_z_velocity: 25
|
||||||
|
max_z_accel: 100
|
||||||
|
|
||||||
|
[stepper_x]
|
||||||
|
step_pin: gpiochip0/gpio31
|
||||||
|
dir_pin: gpiochip0/gpio30
|
||||||
|
enable_pin: !gpiochip0/gpio50
|
||||||
|
endstop_pin: gpiochip0/gpio51
|
||||||
|
homing_retract_dist: 2
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 40
|
||||||
|
position_endstop: 0
|
||||||
|
position_max: 200
|
||||||
|
homing_speed: 50
|
||||||
|
|
||||||
|
[stepper_y]
|
||||||
|
step_pin: gpiochip0/gpio28
|
||||||
|
dir_pin: gpiochip0/gpio41
|
||||||
|
enable_pin: !gpiochip0/gpio66
|
||||||
|
endstop_pin: gpiochip0/gpio49
|
||||||
|
homing_retract_dist: 2
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 40
|
||||||
|
position_endstop: 0
|
||||||
|
position_max: 200
|
||||||
|
homing_speed: 50
|
||||||
|
|
||||||
|
[stepper_z]
|
||||||
|
step_pin: gpiochip0/gpio55
|
||||||
|
dir_pin: !gpiochip0/gpio62
|
||||||
|
enable_pin: !gpiochip0/gpio26
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 8
|
||||||
|
endstop_pin: probe: z_virtual_endstop
|
||||||
|
position_min: -4.0
|
||||||
|
position_max: 300
|
||||||
|
|
||||||
|
[stepper_z1]
|
||||||
|
step_pin: gpiochip0/gpio54
|
||||||
|
dir_pin: !gpiochip0/gpio40
|
||||||
|
enable_pin: !gpiochip0/gpio27
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 8
|
||||||
|
|
||||||
|
[extruder]
|
||||||
|
step_pin: EBBCan: PA9
|
||||||
|
dir_pin: EBBCan: PA8
|
||||||
|
enable_pin: !EBBCan: PA10
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 7.703694208
|
||||||
|
nozzle_diameter: 0.400
|
||||||
|
filament_diameter: 1.750
|
||||||
|
heater_pin: EBBCan:PB1
|
||||||
|
sensor_type: EPCOS 100K B57560G104F
|
||||||
|
sensor_pin: EBBCan:PA0
|
||||||
|
control: pid
|
||||||
|
pid_Kp: 21.527
|
||||||
|
pid_Ki: 1.063
|
||||||
|
pid_Kd: 108.982
|
||||||
|
min_temp: 0
|
||||||
|
max_temp: 240
|
||||||
|
min_extrude_temp: 0
|
||||||
|
|
||||||
|
[heater_fan nozzle_fan]
|
||||||
|
pin: EBBCan:PA2
|
||||||
|
heater: extruder
|
||||||
|
heater_temp: 50.0
|
||||||
|
|
||||||
|
[heater_bed]
|
||||||
|
heater_pin: gpiochip0/gpio65
|
||||||
|
sensor_type: ATC Semitec 104GT-2
|
||||||
|
sensor_pin: analog0
|
||||||
|
control: pid
|
||||||
|
pid_Kp: 21.527
|
||||||
|
pid_Ki: 1.063
|
||||||
|
pid_Kd: 108.982
|
||||||
|
min_temp: 0
|
||||||
|
max_temp: 85
|
||||||
|
|
||||||
|
[z_tilt]
|
||||||
|
z_positions:
|
||||||
|
260, 130# -55,-7
|
||||||
|
-30, 130# -55,320
|
||||||
|
points:
|
||||||
|
20,130
|
||||||
|
180,130
|
||||||
|
retries: 5
|
||||||
|
retry_tolerance: 0.002
|
||||||
|
|
||||||
|
[fan]
|
||||||
|
pin: EBBCan:PA1
|
||||||
|
|
||||||
|
[verify_heater extruder]
|
||||||
|
max_error: 200
|
||||||
|
check_gain_time: 60
|
||||||
|
heating_gain: 1
|
||||||
|
|
||||||
|
[tmc2209 stepper_x]
|
||||||
|
uart_pin: gpiochip0/gpio61
|
||||||
|
tx_pin: gpiochip0/gpio60
|
||||||
|
uart_address: 1
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[tmc2209 stepper_y]
|
||||||
|
uart_pin: gpiochip0/gpio61
|
||||||
|
tx_pin: gpiochip0/gpio60
|
||||||
|
uart_address: 2
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[tmc2209 stepper_z]
|
||||||
|
uart_pin: gpiochip0/gpio61
|
||||||
|
tx_pin: gpiochip0/gpio60
|
||||||
|
uart_address: 3
|
||||||
|
run_current: 1.000
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 30
|
||||||
|
|
||||||
|
[tmc2209 stepper_z1]
|
||||||
|
uart_pin: gpiochip0/gpio61
|
||||||
|
tx_pin: gpiochip0/gpio60
|
||||||
|
uart_address: 0
|
||||||
|
run_current: 1.000
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 30
|
||||||
|
|
||||||
|
[tmc2209 extruder]
|
||||||
|
uart_pin: EBBCan:PA13
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[probe]
|
||||||
|
pin: !EBBCan:PA5
|
||||||
|
x_offset: -42.0
|
||||||
|
y_offset: -4.0
|
||||||
|
speed: 5.0
|
||||||
|
|
||||||
|
[bed_mesh]
|
||||||
|
speed: 80
|
||||||
|
mesh_min: 0,0
|
||||||
|
mesh_max: 150,150
|
||||||
|
probe_count: 5,5
|
||||||
|
|
||||||
|
[bed_screws]
|
||||||
|
screw1: 30,25
|
||||||
|
screw2: 200,25
|
||||||
|
screw3: 200,200
|
||||||
|
screw4: 30, 200
|
||||||
|
|
||||||
|
[input_shaper]
|
||||||
|
shaper_freq_x: 39.4
|
||||||
|
shaper_type_x: mzv
|
||||||
|
shaper_freq_y: 25.0
|
||||||
|
shaper_type_y: mzv
|
||||||
|
|
||||||
|
[virtual_sdcard]
|
||||||
|
path: /var/printer_data/gcodes
|
||||||
|
|
||||||
|
[pause_resume]
|
||||||
|
|
||||||
|
[display_status]
|
||||||
|
|
||||||
|
[homing_override]
|
||||||
|
set_position_z: 0
|
||||||
|
axes: z
|
||||||
|
gcode:
|
||||||
|
G1 Z10 F600
|
||||||
|
G28 X Y
|
||||||
|
G1 X142 Y150 F3000 # (100 + 42, 150 + 4)
|
||||||
|
G28 Z
|
||||||
|
|
||||||
|
[gcode_macro PRINT_END]
|
||||||
|
gcode:
|
||||||
|
# Move Z +25
|
||||||
|
SAVE_GCODE_STATE NAME=_ui_movement
|
||||||
|
G91
|
||||||
|
G1 Z+25 F1500
|
||||||
|
RESTORE_GCODE_STATE NAME=_ui_movement
|
||||||
|
|
||||||
|
# Retract filament
|
||||||
|
SAVE_GCODE_STATE NAME=_ui_extrude
|
||||||
|
M83
|
||||||
|
G1 E-5 F300
|
||||||
|
RESTORE_GCODE_STATE NAME=_ui_extrude
|
||||||
|
|
||||||
|
# Move X and Y to 0
|
||||||
|
G28 X
|
||||||
|
G28 Y
|
||||||
|
|
||||||
|
[gcode_macro START_PRINT]
|
||||||
|
gcode:
|
||||||
|
G28
|
||||||
|
|
||||||
|
[gcode_macro PAUSE]
|
||||||
|
rename_existing: BASE_PAUSE
|
||||||
|
gcode:
|
||||||
|
SAVE_GCODE_STATE NAME=PAUSE_state
|
||||||
|
BASE_PAUSE
|
||||||
|
G91
|
||||||
|
G1 E-{E} F2100
|
||||||
|
G1 Z{Z}
|
||||||
|
G90
|
||||||
|
G1 X{X} Y{Y} F6000
|
||||||
|
|
||||||
|
[gcode_macro RESUME]
|
||||||
|
rename_existing: BASE_RESUME
|
||||||
|
gcode:
|
||||||
|
G91
|
||||||
|
G1 E{E} F2100
|
||||||
|
G90
|
||||||
|
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
|
||||||
|
BASE_RESUME
|
||||||
|
|
||||||
|
[gcode_macro CANCEL_PRINT]
|
||||||
|
rename_existing: BASE_CANCEL_PRINT
|
||||||
|
gcode:
|
||||||
|
TURN_OFF_HEATERS
|
||||||
|
CLEAR_PAUSE
|
||||||
|
SDCARD_RESET_FILE
|
||||||
|
BASE_CANCEL_PRINT
|
||||||
|
|
||||||
|
#*# <---------------------- SAVE_CONFIG ---------------------->
|
||||||
|
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
||||||
|
#*#
|
||||||
|
#*# [probe]
|
||||||
|
#*# z_offset = 0.34
|
||||||
296
config/example-odroidm1s.cfg
Normal file
296
config/example-odroidm1s.cfg
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
# Copyright (C) 2023 Hardkernel Co., Ltd
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
# This file contains common pin mappings for the m1s with board_stepper
|
||||||
|
# To use this config, the firmware should be compiled for the
|
||||||
|
# Linux process.
|
||||||
|
|
||||||
|
[mcu]
|
||||||
|
serial: /tmp/klipper_host_mcu
|
||||||
|
|
||||||
|
[mcu EBBCan] # based on EBB42 CAN V1.0
|
||||||
|
# python3 ~/klipper/lib/canboot/flash_can.py -i can0 -q
|
||||||
|
canbus_uuid: 1e8ea3b32c8a
|
||||||
|
|
||||||
|
[printer]
|
||||||
|
kinematics: cartesian
|
||||||
|
max_velocity: 500
|
||||||
|
max_accel: 5000
|
||||||
|
#max_accel: 7000
|
||||||
|
#max_accel_to_decel: 3500
|
||||||
|
max_z_velocity: 25
|
||||||
|
max_z_accel: 100
|
||||||
|
|
||||||
|
[stepper_x]
|
||||||
|
step_pin: gpiochip2/gpio15
|
||||||
|
dir_pin: gpiochip2/gpio16
|
||||||
|
enable_pin: !gpiochip0/gpio12
|
||||||
|
endstop_pin: gpiochip2/gpio6
|
||||||
|
homing_retract_dist: 2
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 40
|
||||||
|
position_endstop: 0
|
||||||
|
position_max: 240
|
||||||
|
homing_speed: 50
|
||||||
|
|
||||||
|
[stepper_y]
|
||||||
|
step_pin: gpiochip0/gpio13
|
||||||
|
dir_pin: gpiochip0/gpio14
|
||||||
|
enable_pin: !gpiochip3/gpio13
|
||||||
|
endstop_pin: gpiochip3/gpio14
|
||||||
|
homing_retract_dist: 2
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 40
|
||||||
|
position_endstop: 0
|
||||||
|
position_max: 290
|
||||||
|
homing_speed: 50
|
||||||
|
|
||||||
|
[stepper_z]
|
||||||
|
step_pin: gpiochip2/gpio7
|
||||||
|
dir_pin: !gpiochip2/gpio13
|
||||||
|
enable_pin: !gpiochip2/gpio14
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 8
|
||||||
|
endstop_pin: probe: z_virtual_endstop
|
||||||
|
#position_endstop: 0.0
|
||||||
|
position_min: -4.0
|
||||||
|
position_max: 330
|
||||||
|
|
||||||
|
[stepper_z1]
|
||||||
|
step_pin: gpiochip2/gpio9
|
||||||
|
dir_pin: !gpiochip0/gpio18
|
||||||
|
enable_pin: !gpiochip3/gpio11
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 8
|
||||||
|
# #endstop_pin: probe: z_virtual_endstop
|
||||||
|
# position_endstop: 0.0
|
||||||
|
#
|
||||||
|
# [stepper_z2]
|
||||||
|
# step_pin: gpiochip0/gpio11
|
||||||
|
# dir_pin: !gpiochip2/gpio5
|
||||||
|
# enable_pin: !gpiochip3/gpio20
|
||||||
|
# microsteps: 16
|
||||||
|
# rotation_distance: 8
|
||||||
|
# endstop_pin: probe: z_virtual_endstop
|
||||||
|
#position_endstop: 0.0
|
||||||
|
# position_min: -4.0
|
||||||
|
# position_max: 330
|
||||||
|
#
|
||||||
|
# [stepper_z3]
|
||||||
|
# step_pin: gpiochip3/gpio21
|
||||||
|
# dir_pin: !gpiochip3/gpio12
|
||||||
|
# enable_pin: !gpiochip3/gpio20
|
||||||
|
# microsteps: 16
|
||||||
|
# rotation_distance: 8
|
||||||
|
# endstop_pin: probe: z_virtual_endstop
|
||||||
|
# #position_endstop: 0.0
|
||||||
|
# position_min: -4.0
|
||||||
|
# position_max: 330
|
||||||
|
|
||||||
|
[extruder]
|
||||||
|
step_pin: EBBCan: PA9
|
||||||
|
dir_pin: EBBCan: PA8
|
||||||
|
enable_pin: !EBBCan: PA10
|
||||||
|
microsteps: 16
|
||||||
|
rotation_distance: 7.703694208
|
||||||
|
nozzle_diameter: 0.400
|
||||||
|
filament_diameter: 1.750
|
||||||
|
heater_pin: EBBCan:PB1
|
||||||
|
sensor_type: EPCOS 100K B57560G104F
|
||||||
|
sensor_pin: EBBCan:PA0
|
||||||
|
control: pid
|
||||||
|
pid_Kp: 21.527
|
||||||
|
pid_Ki: 1.063
|
||||||
|
pid_Kd: 108.982
|
||||||
|
min_temp: 0
|
||||||
|
max_temp: 240
|
||||||
|
min_extrude_temp: 100
|
||||||
|
|
||||||
|
[heater_fan nozzle_fan]
|
||||||
|
pin: EBBCan:PA2
|
||||||
|
heater: extruder
|
||||||
|
heater_temp: 50.0
|
||||||
|
|
||||||
|
[heater_bed]
|
||||||
|
heater_pin: gpiochip2/gpio10
|
||||||
|
sensor_type: ATC Semitec 104GT-2
|
||||||
|
sensor_pin: analog3
|
||||||
|
control = pid
|
||||||
|
pid_kp = 76.549
|
||||||
|
pid_ki = 0.974
|
||||||
|
pid_kd = 1504.195
|
||||||
|
min_temp: 0
|
||||||
|
max_temp: 85
|
||||||
|
|
||||||
|
[z_tilt]
|
||||||
|
z_positions:
|
||||||
|
260, 130# -55,-7
|
||||||
|
-30, 130# -55,320
|
||||||
|
points:
|
||||||
|
20,130
|
||||||
|
210,130
|
||||||
|
retries: 5
|
||||||
|
retry_tolerance: 0.002
|
||||||
|
|
||||||
|
[fan]
|
||||||
|
pin: EBBCan:PA1
|
||||||
|
|
||||||
|
[verify_heater extruder]
|
||||||
|
max_error: 200
|
||||||
|
check_gain_time: 60
|
||||||
|
heating_gain: 1
|
||||||
|
|
||||||
|
[tmc2209 stepper_x]
|
||||||
|
uart_pin: gpiochip0/gpio16
|
||||||
|
tx_pin: gpiochip0/gpio17
|
||||||
|
uart_address: 0
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[tmc2209 stepper_y]
|
||||||
|
uart_pin: gpiochip0/gpio16
|
||||||
|
tx_pin: gpiochip0/gpio17
|
||||||
|
uart_address: 2
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[tmc2209 stepper_z]
|
||||||
|
uart_pin: gpiochip0/gpio16
|
||||||
|
tx_pin: gpiochip0/gpio17
|
||||||
|
uart_address: 1
|
||||||
|
run_current: 1.000
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 30
|
||||||
|
|
||||||
|
[tmc2209 stepper_z1]
|
||||||
|
uart_pin: gpiochip0/gpio16
|
||||||
|
tx_pin: gpiochip0/gpio17
|
||||||
|
uart_address: 3
|
||||||
|
run_current: 1.000
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 30
|
||||||
|
#
|
||||||
|
# [tmc2209 stepper_z2]
|
||||||
|
# uart_pin: gpiochip2/gpio3
|
||||||
|
# tx_pin: gpiochip2/gpio4
|
||||||
|
# uart_address: 0
|
||||||
|
# run_current: 1.000
|
||||||
|
# hold_current: 0.500
|
||||||
|
# stealthchop_threshold: 30
|
||||||
|
#
|
||||||
|
# [tmc2209 stepper_z3]
|
||||||
|
# uart_pin: gpiochip2/gpio3
|
||||||
|
# tx_pin: gpiochip2/gpio4
|
||||||
|
# uart_address: 2
|
||||||
|
# run_current: 1.000
|
||||||
|
# hold_current: 0.500
|
||||||
|
# stealthchop_threshold: 30
|
||||||
|
|
||||||
|
[tmc2209 extruder]
|
||||||
|
uart_pin: EBBCan:PA13
|
||||||
|
run_current: 0.800
|
||||||
|
hold_current: 0.500
|
||||||
|
stealthchop_threshold: 250
|
||||||
|
|
||||||
|
[probe]
|
||||||
|
pin: !EBBCan:PA5
|
||||||
|
x_offset: -42.0
|
||||||
|
y_offset: -4.0
|
||||||
|
speed: 5.0
|
||||||
|
#samples: 3
|
||||||
|
#sample_retract_dist: 1.0
|
||||||
|
|
||||||
|
[bed_mesh]
|
||||||
|
speed: 80
|
||||||
|
#horizontal_move_z: 3
|
||||||
|
mesh_min: 0,0
|
||||||
|
mesh_max: 180,270
|
||||||
|
probe_count: 3,3
|
||||||
|
#probe_count: 10,10
|
||||||
|
#fade_start: 1.0
|
||||||
|
#fade_end: 10.0
|
||||||
|
|
||||||
|
[bed_screws]
|
||||||
|
screw1: 30,25
|
||||||
|
screw2: 270,25
|
||||||
|
screw3: 270,265
|
||||||
|
screw4: 30, 265
|
||||||
|
|
||||||
|
[input_shaper]
|
||||||
|
shaper_freq_x: 39.4
|
||||||
|
shaper_type_x: mzv
|
||||||
|
shaper_freq_y: 25.0
|
||||||
|
shaper_type_y: mzv
|
||||||
|
|
||||||
|
[virtual_sdcard]
|
||||||
|
path: ~/printer_data/gcodes
|
||||||
|
|
||||||
|
[pause_resume]
|
||||||
|
|
||||||
|
[display_status]
|
||||||
|
|
||||||
|
[homing_override]
|
||||||
|
set_position_z: 0
|
||||||
|
axes: z
|
||||||
|
gcode:
|
||||||
|
G1 Z10 F600
|
||||||
|
G28 X Y
|
||||||
|
G1 X142 Y150 F3000 # (100 + 42, 150 + 4)
|
||||||
|
G28 Z
|
||||||
|
|
||||||
|
[gcode_macro START_PRINT]
|
||||||
|
gcode:
|
||||||
|
G28
|
||||||
|
|
||||||
|
[gcode_macro PAUSE]
|
||||||
|
rename_existing: BASE_PAUSE
|
||||||
|
#default_parameter_X: 230 #edit to your park position
|
||||||
|
#default_parameter_Y: 230 #edit to your park position
|
||||||
|
#default_parameter_Z: 10 #edit to your park position
|
||||||
|
#default_parameter_E: 1 #edit to your retract length
|
||||||
|
gcode:
|
||||||
|
SAVE_GCODE_STATE NAME=PAUSE_state
|
||||||
|
BASE_PAUSE
|
||||||
|
G91
|
||||||
|
G1 E-{E} F2100
|
||||||
|
G1 Z{Z}
|
||||||
|
G90
|
||||||
|
G1 X{X} Y{Y} F6000
|
||||||
|
|
||||||
|
[gcode_macro RESUME]
|
||||||
|
rename_existing: BASE_RESUME
|
||||||
|
#default_parameter_E: 1 #edit to your retract length
|
||||||
|
gcode:
|
||||||
|
G91
|
||||||
|
G1 E{E} F2100
|
||||||
|
G90
|
||||||
|
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
|
||||||
|
BASE_RESUME
|
||||||
|
|
||||||
|
[gcode_macro CANCEL_PRINT]
|
||||||
|
rename_existing: BASE_CANCEL_PRINT
|
||||||
|
gcode:
|
||||||
|
TURN_OFF_HEATERS
|
||||||
|
CLEAR_PAUSE
|
||||||
|
SDCARD_RESET_FILE
|
||||||
|
BASE_CANCEL_PRINT
|
||||||
|
|
||||||
|
#*# <---------------------- SAVE_CONFIG ---------------------->
|
||||||
|
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
||||||
|
#*#
|
||||||
|
#*# [probe]
|
||||||
|
#*# z_offset = 0.34
|
||||||
11
debian/changelog
vendored
Normal file
11
debian/changelog
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
klipper (0.13.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* Version up
|
||||||
|
|
||||||
|
-- YoungSoo Shin <shinys000114@gmail.com> Wed, 04 Jun 2025 09:47:26 +0900
|
||||||
|
|
||||||
|
klipper (0.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- Dongjin Kim <tobetter@gmail.com> Mon, 11 Jan 2021 17:30:47 -0500
|
||||||
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
10
|
||||||
34
debian/control
vendored
Normal file
34
debian/control
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
Source: klipper
|
||||||
|
Maintainer: Kevin O'Connor <kevin@koconnor.net>
|
||||||
|
Uploaders: Dongjin Kim <tobetter@gmail.com>
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Build-Depends: debhelper (>=9),
|
||||||
|
build-essential,
|
||||||
|
libc6-dev,
|
||||||
|
dh-virtualenv (>= 1.0),
|
||||||
|
python3,
|
||||||
|
python3-dev,
|
||||||
|
python3-pip,
|
||||||
|
libffi-dev,
|
||||||
|
|
||||||
|
Standards-Version: 3.9.5
|
||||||
|
Package: klipper
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${misc:Depends},
|
||||||
|
python3,
|
||||||
|
python3-dev,
|
||||||
|
virtualenv,
|
||||||
|
libffi-dev,
|
||||||
|
build-essential,
|
||||||
|
libusb-dev,
|
||||||
|
libusb-1.0-0,
|
||||||
|
usbutils,
|
||||||
|
Description: Klipper Host software
|
||||||
|
...
|
||||||
|
|
||||||
|
Package: klipper-mcu-odroidc5
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Klipper MCU firmware
|
||||||
|
...
|
||||||
1
debian/klipper-mcu-odroidc5.install
vendored
Normal file
1
debian/klipper-mcu-odroidc5.install
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
firmware/* /usr/share/klipper/firmware/
|
||||||
21
debian/klipper-mcu-odroidc5.service
vendored
Normal file
21
debian/klipper-mcu-odroidc5.service
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#Systemd klipper linux mcu Service
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Starts the MCU Linux firmware for klipper on startup
|
||||||
|
Documentation=https://www.klipper3d.org/RPi_microcontroller.html
|
||||||
|
Before=klipper.service
|
||||||
|
ConditionFileIsExecutable=/usr/share/klipper/firmware/LINUX/klipper_mcu
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=KLIPPER_HOST_MCU_SERIAL=/tmp/klipper_host_mcu
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/usr/share/klipper/firmware/LINUX/klipper_mcu -r -I ${KLIPPER_HOST_MCU_SERIAL}
|
||||||
|
ExecStop=sh -c 'echo "FORCE_SHUTDOWN" > ${KLIPPER_HOST_MCU_SERIAL}'
|
||||||
|
ExecStop=sleep 1
|
||||||
|
TimeoutStopSec=2
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
4
debian/klipper.install
vendored
Normal file
4
debian/klipper.install
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
config/* /var/printer_data/config/
|
||||||
|
klippy/* /usr/share/klippy
|
||||||
|
can.conf /lib/modules-load.d/
|
||||||
|
80-can.network /lib/systemd/network/
|
||||||
6
debian/klipper.postinst
vendored
Normal file
6
debian/klipper.postinst
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p "/var/printer_data/logs"
|
||||||
|
ln -s example-odroidc5.cfg /var/printer_data/config/printer.cfg
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
16
debian/klipper.service
vendored
Normal file
16
debian/klipper.service
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#Systemd service file for klipper
|
||||||
|
[Unit]
|
||||||
|
Description=Starts klipper on startup
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/opt/venvs/klipper/bin/python3 \
|
||||||
|
usr/share/klippy/klippy.py \
|
||||||
|
/var/printer_data/config/printer.cfg \
|
||||||
|
-l /var/printer_data/logs/klippy.log \
|
||||||
|
-a /tmp/klipper.sock
|
||||||
31
debian/rules
vendored
Executable file
31
debian/rules
vendored
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
define firmware
|
||||||
|
make distclean
|
||||||
|
echo CONFIG_MACH_LINUX=y | tr -d '[[:space:]]' \
|
||||||
|
> $(shell pwd)/.config && make olddefconfig
|
||||||
|
TOPDIR=$(shell pwd) make
|
||||||
|
mkdir -p $(shell pwd)/firmware/LINUX
|
||||||
|
cp out/klipper.elf $(shell pwd)/firmware/LINUX/klipper_mcu
|
||||||
|
endef
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --with python-virtualenv --with systemd
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
$(call firmware,LINUX,klipper.elf,klipper_mcu)
|
||||||
|
dh_auto_configure
|
||||||
|
|
||||||
|
override_dh_virtualenv:
|
||||||
|
dh_virtualenv --requirements scripts/klippy-requirements.txt --no-package klipper-mcu-odroidc5 --skip-install
|
||||||
|
|
||||||
|
override_dh_strip:
|
||||||
|
dh_strip --exclude=/site-packages/
|
||||||
|
|
||||||
|
override_dh_shlibdeps:
|
||||||
|
dh_shlibdeps --exclude=/site-packages/
|
||||||
|
|
||||||
|
override_dh_auto_install:
|
||||||
|
dh_auto_install
|
||||||
|
dh_systemd_enable || false
|
||||||
|
dh_systemd_start || false
|
||||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
||||||
@@ -70,7 +70,7 @@ def lookup_tmc_uart_mutex(mcu):
|
|||||||
pmutexes.mcu_to_mutex[mcu] = mutex
|
pmutexes.mcu_to_mutex[mcu] = mutex
|
||||||
return mutex
|
return mutex
|
||||||
|
|
||||||
TMC_BAUD_RATE = 40000
|
TMC_BAUD_RATE = 9600
|
||||||
TMC_BAUD_RATE_AVR = 9000
|
TMC_BAUD_RATE_AVR = 9000
|
||||||
|
|
||||||
# Code for sending messages on a TMC uart
|
# Code for sending messages on a TMC uart
|
||||||
|
|||||||
@@ -13,29 +13,55 @@
|
|||||||
#include "internal.h" // report_errno
|
#include "internal.h" // report_errno
|
||||||
#include "sched.h" // sched_shutdown
|
#include "sched.h" // sched_shutdown
|
||||||
|
|
||||||
DECL_CONSTANT("ADC_MAX", 4095); // Assume 12bit adc
|
// ODROID-C5
|
||||||
|
DECL_CONSTANT("ADC_MAX", 1800);
|
||||||
|
|
||||||
#define ANALOG_START (1<<12)
|
#define ANALOG_START (1<<12)
|
||||||
|
|
||||||
DECL_ENUMERATION_RANGE("pin", "analog0", ANALOG_START, 8);
|
DECL_ENUMERATION_RANGE("pin", "analog0", ANALOG_START, 8);
|
||||||
|
|
||||||
#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw"
|
// ODROID-C5
|
||||||
|
#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage0_raw"
|
||||||
|
#define SCALE_PATH "/sys/bus/iio/devices/iio:device0/in_voltage_scale"
|
||||||
|
#define OFFSET_PATH "/sys/bus/iio/devices/iio:device0/in_voltage_offset"
|
||||||
|
|
||||||
struct gpio_adc
|
struct gpio_adc
|
||||||
gpio_adc_setup(uint32_t pin)
|
gpio_adc_setup(uint32_t pin)
|
||||||
{
|
{
|
||||||
char fname[256];
|
struct gpio_adc g;
|
||||||
snprintf(fname, sizeof(fname), IIO_PATH, pin-ANALOG_START);
|
int fd;
|
||||||
|
char buf[64];
|
||||||
|
int ret;
|
||||||
|
|
||||||
int fd = open(fname, O_RDONLY|O_CLOEXEC);
|
fd = open(SCALE_PATH, O_RDONLY);
|
||||||
|
ret = read(fd, buf, sizeof(buf)-1);
|
||||||
|
if (ret <= 0) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
buf[ret] = '\0';
|
||||||
|
g.scale = atof(buf) * 1000;
|
||||||
|
close(fd);
|
||||||
|
|
||||||
|
fd = open(OFFSET_PATH, O_RDONLY);
|
||||||
|
ret = read(fd, buf, sizeof(buf)-1);
|
||||||
|
if (ret <= 0) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
buf[ret] = '\0';
|
||||||
|
g.offset = atoi(buf);
|
||||||
|
close(fd);
|
||||||
|
|
||||||
|
fd = open(IIO_PATH, O_RDONLY|O_CLOEXEC);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
report_errno("analog open", fd);
|
report_errno("analog open", fd);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
int ret = set_non_blocking(fd);
|
ret = set_non_blocking(fd);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
return (struct gpio_adc){ .fd = fd };
|
|
||||||
|
g.fd = fd;
|
||||||
|
return g;
|
||||||
fail:
|
fail:
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -52,6 +78,7 @@ uint16_t
|
|||||||
gpio_adc_read(struct gpio_adc g)
|
gpio_adc_read(struct gpio_adc g)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
int voltage;
|
||||||
int ret = pread(g.fd, buf, sizeof(buf)-1, 0);
|
int ret = pread(g.fd, buf, sizeof(buf)-1, 0);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
report_errno("analog read", ret);
|
report_errno("analog read", ret);
|
||||||
@@ -59,7 +86,14 @@ gpio_adc_read(struct gpio_adc g)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
buf[ret] = '\0';
|
buf[ret] = '\0';
|
||||||
return atoi(buf);
|
|
||||||
|
voltage = atoi(buf) + g.offset;
|
||||||
|
voltage = voltage > 0 ? voltage : 0;
|
||||||
|
voltage = voltage * g.scale;
|
||||||
|
voltage = voltage < 1800000 ? voltage : 1800000;
|
||||||
|
voltage /= 1000;
|
||||||
|
|
||||||
|
return voltage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ void gpio_in_reset(struct gpio_in g, int8_t pull_up);
|
|||||||
uint8_t gpio_in_read(struct gpio_in g);
|
uint8_t gpio_in_read(struct gpio_in g);
|
||||||
|
|
||||||
struct gpio_adc {
|
struct gpio_adc {
|
||||||
|
int scale;
|
||||||
|
int offset;
|
||||||
int fd;
|
int fd;
|
||||||
};
|
};
|
||||||
struct gpio_adc gpio_adc_setup(uint32_t pin);
|
struct gpio_adc gpio_adc_setup(uint32_t pin);
|
||||||
|
|||||||
@@ -172,9 +172,9 @@ stepper_event_full(struct timer *t)
|
|||||||
if (ret == SF_DONE || !timer_is_before(s->time.waketime, min_next_time))
|
if (ret == SF_DONE || !timer_is_before(s->time.waketime, min_next_time))
|
||||||
return ret;
|
return ret;
|
||||||
// Next step event is too close to the last unstep
|
// Next step event is too close to the last unstep
|
||||||
int32_t diff = s->time.waketime - min_next_time;
|
// int32_t diff = s->time.waketime - min_next_time;
|
||||||
if (diff < (int32_t)-timer_from_us(1000))
|
// if (diff < (int32_t)-timer_from_us(1000))
|
||||||
shutdown("Stepper too far in past");
|
// shutdown("Stepper too far in past");
|
||||||
reschedule_min:
|
reschedule_min:
|
||||||
s->time.waketime = min_next_time;
|
s->time.waketime = min_next_time;
|
||||||
return SF_RESCHEDULE;
|
return SF_RESCHEDULE;
|
||||||
|
|||||||
Reference in New Issue
Block a user