Skip to content

Instantly share code, notes, and snippets.

@oct2pus
Last active December 28, 2022 19:50
Show Gist options
  • Select an option

  • Save oct2pus/a27e955f60e84756764524430cf17b30 to your computer and use it in GitHub Desktop.

Select an option

Save oct2pus/a27e955f60e84756764524430cf17b30 to your computer and use it in GitHub Desktop.
current klipper config
# X is currently set to 350 and Y is set to 365
## Movement Locations to work out
## Pre-flight position X100 Y20
## Dock Adjacent position X30 Y0
## Probe pikcup over dock X0 Y0
## Dock exit Position X0 Y40
## Probe Ready Position X150 Y30
# Home position is 20X and and -15Y
# begin_test is used to home the X and Y axis, the Z axis is set to 0 because I currently have no way of homing the Z axis.
[gcode_macro begin_test]
gcode:
G28 X
G28 Y
SET_KINEMATIC_POSITION Z=0
# move_to_dockside moves the print head to the center of the bed, and then Y+30 below the dock.
[gcode_macro move_to_dockside]
gcode:
G90 ; Absolute movement
G0 X175 Y175 Z15 F14000
M400 ; wait for travel
G0 X20 Y15 Z15 F14000
[gcode_macro move_to_dock]
gcode:
M400 ; wait for travel
move_to_dockside
M400 ; wait for travel
move_in_dock
# move_in_dock moves the printhead inside the dock
[gcode_macro move_in_dock]
gcode:
M400 ; wait for travel
G91 ; relative movement
G0 X0 Y-30 Z0 F14000
# move_outof_dock moves the head out of the dock
[gcode_macro move_outof_dock]
gcode:
M400; wait for travel
G91 ; relative movement
G0 X0 Y30 Z0 F14000
# move_outof_dock_stow stows the probe inside the dock
[gcode_macro move_outof_dock_stow]
gcode:
M400; wait for travel
G91; relative movement
G0 X40 Y10 Z0 F14000
[gcode_macro retrieve_probe]
gcode:
M400; wait for travel
move_to_dock
M400; wait for travel
move_outof_dock
M400; wait for travel
G90; absolute movement
G0 X175 Y175 Z15
[gcode_macro stow_probe]
gcode:
M400; wait for travel
move_to_dock
M400; wait for travel
move_outof_dock_stow
M400; wait for travel
G90; absolute movement
G0 X175 Y175 Z15
# Macro to Deploy Bed Probe
[gcode_macro _M401]
gcode:
G90
{% if printer.probe.last_query %}
G0 Z15 F14000 ; set approach elevation of Z10
;#move_to_dockside ;
move_to_dock ; translate over probe pickup location
move_outof_dock ; translate to side to exit dock
G0 Z15 F14000 ; raise to elevation of Z20
error_if_probe_not_deployed
{% endif %}
# Macro to Stow Bed Leveling Probe
[gcode_macro _M402]
gcode:
G90
{% if not printer.probe.last_query %}
G0 Z15 F14000 ; set approach elevation of Z15
move_to_dock
move_outof_dock_stow
G90
G0 X175 Y175 Z15 F14000 ; move up to elevation of Z15
error_if_probe_deployed
{% endif %}
[gcode_macro do_error_if_probe_deployed]
gcode:
{% if not printer.probe.last_query %}
{action_raise_error("Euclid Probe is already deployed - Remove and Return it to the dock")}
{% endif %}
[gcode_macro error_if_probe_deployed]
gcode:
G4 P300
QUERY_PROBE
do_error_if_probe_deployed
[gcode_macro do_error_if_probe_not_deployed]
gcode:
{% if printer.probe.last_query %}
{action_raise_error("Euclid Probe Unsuccessfully Deployed!")}
{% endif %}
[gcode_macro error_if_probe_not_deployed]
gcode:
G4 P300
QUERY_PROBE
do_error_if_probe_not_deployed
[include mainsail.cfg]
[include euclid.cfg]
[include menu.cfg]
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
# This file contains common pin mappings for the BigTreeTech Octopus.
# To use this config, the firmware should be compiled for the
# STM32F446 with a "32KiB bootloader" and a "12MHz crystal" clock reference.
# See docs/Config_Reference.md for a description of parameters.
########################################
# Driver Configuration
########################################
# Driver0 x
[stepper_x]
step_pin: PF13
dir_pin: !PF12
enable_pin: !PF14
microsteps: 16
rotation_distance: 40
endstop_pin: PG6
position_endstop: 350
position_max: 350
homing_speed: 100
[tmc2208 stepper_x]
uart_pin: PC4
#diag_pin: PG6
run_current: 0.800
stealthchop_threshold: 999999
# Driver1 y
[stepper_y]
step_pin: PG0
dir_pin: !PG1
enable_pin: !PF15
microsteps: 16
rotation_distance: 40
endstop_pin: PG9
position_endstop: 350
position_max: 350
position_min: -15
homing_speed: 100
[tmc2208 stepper_y]
uart_pin: PD11
#diag_pin: PG9
run_current: 0.800
stealthchop_threshold: 999999
# Driver2 z
[stepper_z]
step_pin: PG4
dir_pin: !PC1
#step_pin: PF11
#dir_pin: !PG3
enable_pin: !PG5
microsteps: 16
rotation_distance: 4
endstop_pin: probe:z_virtual_endstop #PG10 # I DONT HAVE AN ENDSTOP HERE
#position_endstop: 0.5
position_max: 400
position_min: -5
homing_speed: 10.0
#homing_positive_dir: true
[tmc2208 stepper_z]
uart_pin: PC6
#diag_pin: PG10
run_current: 0.650
stealthchop_threshold: 999999
# Driver3 z1
[stepper_z1]
#step_pin: PG4
#dir_pin: !PC1
step_pin: PF11
dir_pin: !PG3
enable_pin: !PA0
microsteps: 16
rotation_distance: 4
endstop_pin: probe:z_virtual_endstop
#position_max: 400
#position_min: 0
#position_max: 400
#homing_speed: 10.0
[tmc2208 stepper_z1]
uart_pin: PC7
#diag_pin: PG11
run_current: 0.650
stealthchop_threshold: 999999
# ADJUST THESE BASED ON OFFSET FROM PROBE, NOT THE NOZZLE
[z_tilt]
z_positions: 0, 175
350, 175
# A list of X, Y coordinates (one per line; subsequent lines
# indented) describing the location of each bed "pivot point". The
# "pivot point" is the point where the bed attaches to the given Z
# stepper. It is described using nozzle coordinates (the X, Y position
# of the nozzle if it could move directly above the point). The
# first entry corresponds to stepper_z, the second to stepper_z1,
# the third to stepper_z2, etc. This parameter must be provided.
points: 0, 159
139, 159
316, 159
# A list of X, Y coordinates (one per line; subsequent lines
# indented) that should be probed during a Z_TILT_ADJUST command.
# Specify coordinates of the nozzle and be sure the probe is above
# the bed at the given nozzle coordinates. This parameter must be
# provided.
#speed: 50
# The speed (in mm/s) of non-probing moves during the calibration.
# The default is 50.
horizontal_move_z: 10
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#retries: 0
# Number of times to retry if the probed points aren't within
# tolerance.
#retry_tolerance: 0
# If retries are enabled then retry if largest and smallest probed
# points differ more than retry_tolerance. Note the smallest unit of
# change here would be a single step. However if you are probing
# more points than steppers then you will likely have a fixed
# minimum value for the range of probed points which you can learn
# by observing command output.
# Driver4 extruder
# TODO: THIS IS BASED ON THE DEFAULT EXTRUDER, IM USING THE DIRECT DRIVE EXTRUDER FROM MICROSWISS
[extruder]
step_pin: PF9
dir_pin: !PF10
enable_pin: !PG2
microsteps: 16
#rotation_distance: 33.683
# rotation_distance = <full_steps_per_rotation> * <microsteps> / <steps_per_mm>
# 79mm when asked for 100
# 16 microsteps
# 200 full steps
# new Steps/mm = 137.43712721157323
# old steps/mm = 120.25748631012658
rotation_distance: 23.28337375
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA2 # HE0
sensor_pin: PF4 # T0
sensor_type: EPCOS 100K B57560G104F
#control: pid
#pid_Kp: 22.2
#pid_Ki: 1.08
#pid_Kd: 114
min_temp: 0
max_temp: 260
[tmc2208 extruder]
uart_pin: PF2
run_current: 0.800
stealthchop_threshold: 999999
########################################
# Probe Configuration
########################################
[probe]
## Euclid Probe
pin: ^PG10 # in J31 on Octopus board
x_offset: 36
y_offset: 16
#z_offset: 4.480
#z_offset: 10.83
speed: 5
samples: 2
samples_result: average
sample_retract_dist: 5.0
samples_tolerance: 0.050
samples_tolerance_retries: 3
lift_speed: 30
# euclid.cfg has all the gcode movements
[homing_override]
gcode:
SET_KINEMATIC_POSITION Z=0
G0 Z15 F500 ; lower bed to 15
G28 X Y ; home X & Y
M401 ; deploy Euclid Probe
G90
G0 X175 Y175 F6000 ; move to X175 Y175
G28 Z ; home Z
G90
G0 Z15 F500 ; lower bed to 15
M402 ; retract Euclid Probe
#[safe_z_home]
#home_xy_position: 180, 180
#speed: 100
#z_hop: 10
#z_hop_speed: 5
[bed_mesh]
speed: 100
horizontal_move_z: 15
mesh_min: 40, 40
mesh_max: 310, 310
probe_count: 5, 5
#35, 50 back right
#315, 50 back left
#35, 300 front right
#315 ,300 front left
[screws_tilt_adjust]
screw1: 0,34
screw1_name: back_right
screw2: 289, 34
screw2_name: back_left
screw3: 0,286
screw3_name: front_right
screw4: 289,286
screw4_name: front_left
# Additional bed leveling screws. At least two screws must be
# defined.
speed: 50
horizontal_move_z: 15
screw_thread: CW-M3
########################################
# Heated Bed
########################################
[heater_bed]
heater_pin: PA1
sensor_pin: PF3 # TB
sensor_type: EPCOS 100K B57560G104F
#control: pid
#pid_Kp: 690.34
#pid_Ki: 111.47
#pid_Kd: 1068.83
min_temp: 0
max_temp: 130
########################################
# Fans
########################################
[fan]
pin: PA8
[heater_fan fan1]
pin: PE5
[heater_fan fan2]
pin: PD12
######################################################################
# Filament Sensor
######################################################################
# TODO: CHECK WHAT PIN THIS SHOULD BE
#[filament_switch_sensor filament_sensor]
#switch_pin:PE4
######################################################################
# Fysetc Mini 12864Panel v2.1 (with neopixel backlight leds)
######################################################################
[board_pins]
aliases:
# EXP1 header
EXP1_1=PE8, EXP1_2=PE7,
EXP1_3=PE9, EXP1_4=PE10,
EXP1_5=PE12, EXP1_6=PE13, # Slot in the socket on this side
EXP1_7=PE14, EXP1_8=PE15,
EXP1_9=<GND>, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PA6, EXP2_2=PA5,
EXP2_3=PB1, EXP2_4=PA4,
EXP2_5=PB2, EXP2_6=PA7, # Slot in the socket on this side
EXP2_7=PC15, EXP2_8=<RST>,
EXP2_9=<GND>, EXP2_10=PC5
[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
# Some micro-controller boards may require an spi bus to be specified:
spi_bus: spi1
# Alternatively, some micro-controller boards may work with software spi:
#spi_software_miso_pin: EXP2_1
#spi_software_mosi_pin: EXP2_6
[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
########################################
# Printer Info
########################################
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_290036001551303432323631-if00
# CAN bus is also available on this board
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 2500
max_z_velocity: 5
max_z_accel: 100
########################################
# Misc.
########################################
[force_move]
enable_force_move: True
# Set to true to enable FORCE_MOVE and SET_KINEMATIC_POSITION
# extended G-Code commands. The default is false.
[respond]
default_type: echo
# Sets the default prefix of the "M118" and "RESPOND" output to one
# of the following:
# echo: "echo: " (This is the default)
# command: "// "
# error: "!! "
default_prefix: echo:
# Directly sets the default prefix. If present, this value will
# override the "default_type".
[gcode_macro M401]
gcode:
G90
{action_respond_info("Entering M401")}
error_if_probe_deployed ; check to make sure that the probe is not already attached
_M401
[gcode_macro M402]
gcode:
G90
{action_respond_info("Entering M402")}
error_if_probe_not_deployed
_M402
[gcode_macro error_if_probe_deployed]
gcode:
QUERY_PROBE ; check probe status
do_error_if_probe_deployed ; logic check to verify probe is not already deployed
[gcode_macro do_error_if_probe_deployed]
gcode:
{% if not printer.probe.last_query %}
{action_raise_error("Euclid Probe is already deployed - Remove and Return it to the dock")}
{% endif %}
{action_respond_info("Exiting M401")}
######################################################################
# Extra Drivers
######################################################################
#[filament_switch_sensor material_0]
#switch_pin: PG12
# Driver5
#[extruder1]
#step_pin: PC13
#dir_pin: PF0
#enable_pin: !PF1
#heater_pin: PA3 # HE1
#sensor_pin: PF5 # T1
#...
#[filament_switch_sensor material_1]
#switch_pin: PG13
# Driver6
#[extruder2]
#step_pin: PE2
#dir_pin: PE3
#enable_pin: !PD4
#heater_pin: PB10 # HE2
#sensor_pin: PF6 # T2
#...
#[filament_switch_sensor material_2]
#switch_pin: PG14
# Driver7
#[extruder3]
#step_pin: PE6
#dir_pin: PA14
#enable_pin: !PE0
#heater_pin: PB11 # HE3
#sensor_pin: PF7 # T3
#...
#[filament_switch_sensor material_3]
#switch_pin: PG15
########################################
# TMC2209 configuration
########################################
#[tmc2209 stepper_x]
#uart_pin: PC4
##diag_pin: PG6
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2209 stepper_y]
#uart_pin: PD11
##diag_pin: PG9
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2209 stepper_z]
#uart_pin: PC6
##diag_pin: PG10
#run_current: 0.650
#stealthchop_threshold: 999999
#[tmc2209 stepper_]
#uart_pin: PC7
##diag_pin: PG11
#run_current: 0.650
#stealthchop_threshold: 999999
#[tmc2209 extruder]
#uart_pin: PF2
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2209 extruder1]
#uart_pin: PE4
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2209 extruder2]
#uart_pin: PE1
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2209 extruder3]
#uart_pin: PD3
#run_current: 0.800
#stealthchop_threshold: 999999
########################################
# TMC2130 configuration
########################################
#[tmc2130 stepper_x]
#cs_pin: PC4
#spi_bus: spi1
##diag1_pin: PG6
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 stepper_y]
#cs_pin: PD11
#spi_bus: spi1
##diag1_pin: PG9
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 stepper_z]
#cs_pin: PC6
#spi_bus: spi1
##diag1_pin: PG10
#run_current: 0.650
#stealthchop_threshold: 999999
#[tmc2130 stepper_]
#cs_pin: PC7
#spi_bus: spi1
##diag1_pin: PG11
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 extruder]
#cs_pin: PF2
#spi_bus: spi1
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 extruder1]
#cs_pin: PE4
#spi_bus: spi1
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 extruder2]
#cs_pin: PE1
#spi_bus: spi1
#run_current: 0.800
#stealthchop_threshold: 999999
#[tmc2130 extruder3]
#cs_pin: PD3
#spi_bus: spi1
#run_current: 0.800
#stealthchop_threshold: 999999
########################################
# Fans
########################################
#[heater_fan fan3]
#pin: PD13
#[heater_fan fan4]
#pin: PD14
#[controller_fan fan5]
#pin: PD15
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 5.235
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.375625, -0.056875, 0.032500, -0.014375, -0.261250
#*# -0.271875, -0.072500, 0.088750, -0.028125, -0.250000
#*# -0.235625, -0.062500, 0.036875, -0.030625, -0.255000
#*# -0.248750, -0.111250, -0.056250, -0.162500, -0.305000
#*# -0.318750, -0.138125, -0.155625, -0.227500, -0.338125
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 40.0
#*# max_x = 310.0
#*# min_y = 40.0
#*# max_y = 310.0
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 31.923
#*# pid_ki = 1.531
#*# pid_kd = 166.398
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 63.727
#*# pid_ki = 0.787
#*# pid_kd = 1290.467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment