feat: pre-firmware update backup

This commit is contained in:
aria 2025-05-26 18:35:44 +10:00
commit 350e5c46cc
Signed by: aria
SSH key fingerprint: SHA256:WqtcVnDMrv1lnUlNah5k31iywFUI/DV+5yHzCTO4Vds
8 changed files with 1204 additions and 0 deletions

7
.cz.toml Normal file
View file

@ -0,0 +1,7 @@
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "semver"
version = "0.0.1"
update_changelog_on_bump = true
major_version_zero = true

17
Neptune4Pro/adxlmcu.cfg Normal file
View file

@ -0,0 +1,17 @@
[mcu adxl]
serial: /dev/serial/by-id/usb-Anchor_Rampon-if00
[adxl345]
cs_pin: adxl:CS
[resonance_tester]
accel_chip: adxl345
probe_points:
125,125,20
# Edit the above line with the correct probe points location. I recommend the center of your bed for X & Y, 20 for Z.
# For 350 mm printers: 175,175,20
# For 300 mm printers: 150,150,20
# For 250 mm printers: 125,125,20
# For 120 mm printers: 60,60,20
# More info: https://www.klipper3d.org/Config_Reference.html#adxl345

70
Neptune4Pro/fluidd.cfg Normal file
View file

@ -0,0 +1,70 @@
[virtual_sdcard]
path: /home/mks/gcode_files
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}

26
Neptune4Pro/macros.cfg Normal file
View file

@ -0,0 +1,26 @@
[screws_tilt_adjust]
screw1: 52,21
screw1_name: front left screw
screw2: 222, 21
screw2_name: front right screw
screw3: 222, 191
screw3_name: rear right screw
screw4: 52, 191
screw4_name: rear left screw
horizontal_move_z: 10
speed: 50
screw_thread: CW-M3 #measure the diameter of your adjustment screw
[gcode_macro Z_LIGHTS]
description: Turn LEDs on/off
gcode:
RUN_SHELL_COMMAND CMD=FLASHLIGHT
RUN_SHELL_COMMAND CMD=MODLELIGHT
[gcode_shell_command FLASHLIGHT]
command: sh /home/mks/sled2.sh
timeout: 5.
[gcode_shell_command MODLELIGHT]
command: sh /home/mks/sled1.sh
timeout: 5.

View file

@ -0,0 +1,36 @@
[server]
host: 0.0.0.0
port: 7125
enable_debug_logging: False
klippy_uds_address: /tmp/klippy_uds
[authorization]
trusted_clients:
10.0.0.0/8
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.168.0.0/16
192.168.20.0/24
FE80::/10
::1/128
cors_domains:
http://*.lan
http://*.local
https://my.mainsail.xyz
http://my.mainsail.xyz
https://app.fluidd.xyz
http://app.fluidd.xyz
https://localfile.buymymojo.net
[database]
database_path: /home/mks/.moonraker_database
[file_manager]
config_path: /home/mks/klipper_config
log_path: /home/mks/klipper_logs
[octoprint_compat]
[history]

63
Neptune4Pro/plr.cfg Normal file
View file

@ -0,0 +1,63 @@
[force_move]
enable_force_move: True
[delayed_gcode KINEMATIC_POSITION]
initial_duration:0.2
gcode:
SET_KINEMATIC_POSITION X=0
SET_KINEMATIC_POSITION Y=0
SET_KINEMATIC_POSITION Z=0
[respond]
default_type: echo
[gcode_macro G31]
gcode:
RUN_SHELL_COMMAND CMD=clear_plr
[gcode_shell_command clear_plr]
command: sh /home/mks/clear_plr.sh
timeout: 5.
[gcode_macro save_last_file]
gcode:
{% set svv = printer.save_variables.variables %}
{% set filepath=printer.virtual_sdcard.file_path %}
{% set filename=filepath.split('/')%}
SAVE_VARIABLE VARIABLE=last_file VALUE='"{ filename[-1] }"'
SAVE_VARIABLE VARIABLE=filepath VALUE='"{ printer.virtual_sdcard.file_path }"'
M118 Last File: { filename[-1] }
[gcode_macro clear_last_file]
gcode:
{% set filename='' %}
{% set filepath='' %}
SAVE_VARIABLE VARIABLE=last_file VALUE='"{ filename }"'
SAVE_VARIABLE VARIABLE=filepath VALUE='"{ filepath }"'
[gcode_shell_command POWER_LOSS_RESUME]
command: /home/mks/plr.sh
timeout: 420.
[gcode_macro RESUME_INTERRUPTED]
gcode =
SET_GCODE_OFFSET Z=0 MOVE=0
{% set z_height = params.Z_HEIGHT|default(printer.save_variables.variables.power_resume_z)|float %}
{% set last_file = params.GCODE_FILE|default(printer.save_variables.variables.last_file)|string %}
m118 {last_file}
RUN_SHELL_COMMAND CMD=POWER_LOSS_RESUME PARAMS="{z_height} \"{last_file}\""
SDCARD_PRINT_FILE FILENAME=plr/"{last_file}"
[gcode_macro LOG_Z]
gcode:
{% set z_pos = printer.gcode_move.gcode_position.z %}
RESPOND MSG="Current Z is {z_pos}"
SAVE_VARIABLE VARIABLE=power_resume_z VALUE={z_pos}
[save_variables]
filename =/home/mks/klipper_config/saved_variables.cfg

906
Neptune4Pro/printer.cfg Normal file
View file

@ -0,0 +1,906 @@
####################################################################################
# Machine type: NEPTUNE 4 PRO
# Current configuration version: V1.4
# Date2023-12-1
####################################################################################
# This product (Neptune 4/4pro/4plus/4max) adopts Klipper firmware
# and does not support users to update the official klipper/fluidd
# /moonraker by themselves, otherwise the machine will not work properly.
# If you want to DIY and are an expert or interested in this field,
# we recommend that you prepare your own tools for burning images so
# that you can restore them if problems arise. Please contact after-sales
# support team for tutorials on burning images. Thank you for your cooperation!
####################################################################################
# This file contains common pin mappings for ZNP-K1-V1.0
# boards. To use this config, the firmware should be compiled for the
# STM32F402. When running "make menuconfig", enable "extra low-level
# configuration setup", select the 32KiB bootloader, and serial (on
# USART1 PA10/PA9) communication.
# The "make flash" command does not work on the ZN-K1-V1.0. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "elegoo_k1.bin" on an SD card and then restart the ZNP-K1-V1.0
# with that SD card.
# See docs/Config_Reference.md for a description of parameters.
####################################################################################
[include plr.cfg]
[include macros.cfg]
# [include adxlmcu.cfg]
[mcu]
# The hardware use USART1 PA10/PA9 connect to RK3328
serial: /dev/ttyS0
restart_method: command
[stepper_x]
step_pin:PC14
dir_pin:PC13
enable_pin:!PC15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:PC0
position_min: -10
position_endstop:-8
position_max: 235
homing_speed:50
homing_retract_dist:5
homing_positive_dir:false
[stepper_y]
step_pin:PB4
dir_pin:PB3
enable_pin:!PB5
microsteps:16
rotation_distance: 40
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:PB8
position_min: -2
position_endstop:0
position_max:235
homing_speed:50
homing_retract_dist:5
homing_positive_dir:false
[stepper_z]
step_pin:PC10
dir_pin:!PA15
enable_pin: !PC11
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin:probe:z_virtual_endstop ## PB12 for Z-max; endstop have'!' is NO
## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
## (+) value = endstop above Z0, (-) value = endstop below
## Increasing position_endstop brings nozzle closer to the bed
## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
#position_endstop:-5
position_max: 268
position_min: -5
homing_speed: 8
homing_retract_dist: 5
second_homing_speed: 3
[extruder]
step_pin:PA5
dir_pin:!PA6
enable_pin:!PA4
microsteps:16
rotation_distance: 29.07 # Sunlu PLA
# rotation_distance: 28 # #3DFillies PETG
# rotation_distance: 28 # #3DFillies PLA Matte
#rotation_distance: 28.7086 #31.4 #Bondtech 5mm Drive Gears # DEFAULT
gear_ratio: 52:10
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.750
min_temp: 0
max_temp: 330
heater_pin: PA7
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin: PA1
max_power: 1
# 255C [3DFillies PETG]
# control: pid
# pid_kp: 20.038
# pid_ki: 0.947
# pid_kd: 105.953
# 250C
# control: pid
# pid_kp: 21.629
# pid_ki: 1.276
# pid_kd: 91.651
# 220C [Sunlu PLA+ 2.0]
control: pid
pid_kp: 19.639
pid_ki: 0.977
pid_kd: 98.687
# 215C [Sunlu PLA]
# control: pid
# pid_kp: 21.4275
# pid_ki: 1.172
# pid_kd: 96.537
# 210C [3DFillies PLA Mate]
# control: pid
# pid_kp: 22.471
# pid_ki: 1.338
# pid_kd: 94.378
#control : pid
#pid_kp : 26.213
#pid_ki : 1.304
#pid_kd : 131.721
# pressure_advance: 0.0475 # 3DFillies PETG
pressure_advance: 0.02 # [SUNLU PLA+ V2]
# pressure_advance: 0.021 # [3DFillies PLA Mate, SUNLU PLA]
#pressure_advance: 0.024 #DEFAULT
pressure_advance_smooth_time: 0.01
instantaneous_corner_velocity: 2.5
max_extrude_only_distance: 300
max_extrude_only_velocity:30
max_extrude_only_accel:5000
max_extrude_cross_section: 99
min_extrude_temp:0
[verify_heater extruder]
max_error: 120
check_gain_time:30
hysteresis: 10
heating_gain: 2
[heater_bed]
heater_pin:PB10
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA0
max_power: 1.0
# 80C
# control: pid
# pid_Kp: 70.251
# pid_Ki: 2.178
# pid_Kd: 566.400
# 75C
# control: pid
# pid_Kp: 68.956
# pid_Ki: 2.168
# pid_Kd: 548.198
# 65C
control: pid
pid_kp: 69.585
pid_ki: 2.220
pid_kd: 545.376
# Default
#control = pid
#pid_kp = 75.397
#pid_ki = 0.823
#pid_kd = 1727.531
min_temp: 0
max_temp: 120
[verify_heater heater_bed]
max_error: 120
check_gain_time:120
hysteresis: 10
heating_gain: 2
[respond]
default_type: echo
default_prefix: echo:
[virtual_sdcard]
path: ~/gcode_files
on_error_gcode:
# test OK
G91
G1 Z25 F900
G90
TURN_OFF_HEATERS
M106 S100
M84
M300 P10000 S1
G4 P300
M300
M300
M300
M300
M300
M300
M300
M300
M300
M300
M300
########################################
# PRINT_START/CANCEL_PRINT/PAUSE/RESUME/filament_switch_sensor
########################################
[print_stats]
[gcode_move]
[gcode_macro PRINT_START]
gcode:
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=True
G92 E0
G90
CLEAR_PAUSE
M117 Printing
[gcode_macro PRINT_END]
gcode:
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False
RUN_SHELL_COMMAND CMD=clear_plr
clear_last_file
{% set RUN_VELOCITY = printer.configfile.settings['printer'].max_velocity|float %}
{% set RUN_ACCEL = printer.configfile.settings['printer'].max_accel|float %}
{% set RUN_DECEL = printer.configfile.settings['printer'].max_accel_to_decel|float %}
SET_VELOCITY_LIMIT VELOCITY={RUN_VELOCITY} ACCEL={RUN_ACCEL} ACCEL_TO_DECEL={RUN_DECEL}
M220 S100
M221 S100
{% set z = params.Z|default(100)|int %}
{% if (printer.gcode_move.position.z+5) < z %}
G90
G1 Z{z+5} F6000
{% endif %}
TURN_OFF_HEATERS
M107
M84
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False
RUN_SHELL_COMMAND CMD=clear_plr
clear_last_file
{% set RUN_VELOCITY = printer.configfile.settings['printer'].max_velocity|float %}
{% set RUN_ACCEL = printer.configfile.settings['printer'].max_accel|float %}
{% set RUN_DECEL = printer.configfile.settings['printer'].max_accel_to_decel|float %}
SET_VELOCITY_LIMIT VELOCITY={RUN_VELOCITY} ACCEL={RUN_ACCEL} ACCEL_TO_DECEL={RUN_DECEL}
{% set z = params.Z|default(100)|int %}
{% set x_park = params.X|default(printer.toolhead.axis_minimum.x+5)|int %}
{% set y_park = params.Y|default(printer.toolhead.axis_maximum.y-5)|int %}
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
SDCARD_RESET_FILE
M220 S100
M221 S100
M400
G91
M83
G1 E-10.0 F1200
TURN_OFF_HEATERS
M107
{% if (printer.gcode_move.position.z+5) < z %}
G90
G0 X{x_park} Y{y_park} Z{z+5} F6000
{% endif %}
{%if (printer.gcode_move.position.z+5) >= z %}
{%if (printer.gcode_move.position.z+5) < printer.toolhead.axis_maximum.z %}
G91
G1 Z5 F300
G90
G0 X{x_park} Y{y_park} F6000
{% else %}
G90
G0 X{x_park} Y{y_park} Z{printer.toolhead.axis_maximum.z} F6000
{% endif %}
{% endif %}
M84
[pause_resume]
recover_velocity: 50.0
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
M400
{% set z = params.Z|default(30)|int %}
{% set E = (params.E|default(2))|float %}
{% set x_park = params.X|default(printer.toolhead.axis_minimum.x+5)|int %}
{% set y_park = params.Y|default(printer.toolhead.axis_maximum.y-5)|int %}
{% if (printer.gcode_move.position.x) <= (x_park+1) and (printer.gcode_move.position.y) >= (y_park-1) %}
M400
{% else %}
{% set position = printer.gcode_move.gcode_position %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=saved_x VALUE="{position.x}"
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=saved_y VALUE="{position.y}"
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=saved_z VALUE="{position.z}"
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=saved_e VALUE="{E}"
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=bed_temp VALUE={printer['heater_bed'].target}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=bed1_temp VALUE={printer['heater_generic heater_bed1'].target}
SAVE_GCODE_STATE NAME=timelapse_state_a
M83
G91
{% if (printer.gcode_move.position.z+5) < printer.toolhead.axis_maximum.z %}
G1 E-2 X3 Z1 F2100
G1 Z4 F600
{% endif %}
SAVE_GCODE_STATE NAME=timelapse_state_b
G90
{% if (printer.gcode_move.position.z+5) < z %}
G1 Z{z+5} X{x_park} Y{y_park} E-20 F6000
{% else %}
G1 X{x_park} Y{y_park} E-20 F6000
{% endif %}
M400
M25
SET_IDLE_TIMEOUT TIMEOUT=1200
M400
{% endif %}
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
variable_bed_temp: 0
variable_bed1_temp: 0
variable_saved_x: 0.0
variable_saved_y: 0.0
variable_saved_z: 0.0
variable_saved_e: 0.0
gcode:
M24
{% set e = params.E|default(2)|int %}
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
{% if printer[printer.toolhead.extruder].temperature < etemp-4 %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={etemp}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bed_temp}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={bed1_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={etemp-4} MAXIMUM={etemp+10}
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={etemp}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bed_temp}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={bed1_temp}
M17 E
G91
M83
G1 E100 F200
G4 P2000
G1 X20 F15000
G1 X-20
G1 X20
G1 X-20
G1 X20
G1 X-20
;G1 E-2 F600
G90
G92 E{saved_e}
RESTORE_GCODE_STATE NAME=timelapse_state_b MOVE=1 MOVE_SPEED=250
RESTORE_GCODE_STATE NAME=timelapse_state_a MOVE=1 MOVE_SPEED=250
SAVE_GCODE_STATE NAME=timelapse_state_a
SAVE_GCODE_STATE NAME=timelapse_state_b
M400
;M24
[filament_switch_sensor fila]
pause_on_runout: True
runout_gcode:
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
insert_gcode:
event_delay: 3.0
pause_delay: 1.0
switch_pin: PA12
##############################################################
#fan for printed model FAN0
[fan]
pin: PC9
#fan for hotend FAN1
[heater_fan fan1]
pin: PA8
shutdown_speed: 1
# [controller_fan controller_fan1]
# pin: PA8
# fan_speed: 1.0
# idle_timeout: 900
[printer]
kinematics:cartesian
max_velocity: 500
max_accel: 4800
# max_accel: 5000
max_accel_to_decel: 2500
max_z_velocity: 20
max_z_accel: 100
square_corner_velocity: 9.0
[input_shaper]
# shaper_freq_x: 66.66
shaper_freq_x: 96.2
shaper_freq_y: 40.2
# shaper_freq_y: 42.05
# shaper_type_x: mzv
shaper_type_x: mzv
shaper_type_y: mzv
# shaper_type_y: ei
#damping_ratio_x: 0.1
#damping_ratio_y: 0.1
####################################################################
# Homing and Gantry Adjustment Routines
#####################################################################
[idle_timeout]
timeout: 3600
gcode:
{% if printer[printer.toolhead.extruder].temperature > 140 %} # Reduce the hot end temperature after 10 minutes
{action_respond_info("Extruder powered down on idle timeout.")}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={120} # After pausing printing, reduce nozzle temperature to 50℃
M84 E
# SET_IDLE_TIMEOUT TIMEOUT=259200 # Timer duration 3 days.
{% else %}
TURN_OFF_HEATERS
M84 E
{% endif %}
[safe_z_home]
home_xy_position: 141.75,97.05
speed: 200
z_hop: 10
z_hop_speed: 5
[gcode_macro G29]
gcode:
M400
BED_MESH_CLEAR
G28
BED_MESH_CALIBRATE profile=6 mesh_min=10,21 mesh_max=200,220 probe_count=6 algorithm=bicubic
M400
G4 P2000
G91
G1 Z5 F300
G90
G28 Z
G1 X117.5 Y117.5 F12000
G1 Z0 F300
#####################################################################
# Probe
#####################################################################
[probe]
pin:^PA11
x_offset: -24.25
y_offset: 20.45
z_offset: 1.650 # Flat Side
# z_offset: 1.800
speed: 10.0
samples: 2
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.05
samples_tolerance_retries: 5
[bed_mesh]
speed:500
horizontal_move_z:10
mesh_min:10,21
mesh_max:210,211
probe_count:6,6
algorithm:bicubic
bicubic_tension:0.2
mesh_pps: 2, 2
fade_start:5.0
fade_end:30.0
#####################################################################
# LED Control
#####################################################################
[output_pin caselight]
pin: PB7
pwm: false
shutdown_value:0
value:0.0
[output_pin caselight1]
pin: PC7
pwm: false
shutdown_value:0
value:0.0
[gcode_macro FLASHLIGHT_ON]
description: Turn on Hotend LEDs
gcode:
SET_PIN PIN=caselight VALUE=1
[gcode_macro FLASHLIGHT_OFF]
description: Turn off Hotend LEDs
gcode:
SET_PIN PIN=caselight VALUE=0
[gcode_macro MODLELIGHT_ON]
description: Turn on Logo LEDs
gcode:
SET_PIN PIN=caselight1 VALUE=1
[gcode_macro MODLELIGHT_OFF]
description: Turn off Logo LEDs
gcode:
SET_PIN PIN=caselight1 VALUE=0
# [gcode_macro FLASHLIGHT_SWITCH]
# description: Switch Hotend LEDs
# gcode:
# RUN_SHELL_COMMAND CMD=FLASHLIGHT
# [gcode_shell_command FLASHLIGHT]
# command: sh /home/mks/sled2.sh
# timeout: 5.
# [gcode_macro MODLELIGHT_SWITCH]
# description: Switch Logo LEDs
# gcode:
# RUN_SHELL_COMMAND CMD=MODLELIGHT
# [gcode_shell_command MODLELIGHT]
# command: sh /home/mks/sled1.sh
# timeout: 5.
########################################
# TMC UART configuration
########################################
[tmc2209 stepper_x]
uart_pin: PB9
run_current: 1.0
hold_current: 0.8
interpolate: True
stealthchop_threshold:0
[tmc2209 stepper_y]
uart_pin: PD2
run_current: 1.1
hold_current: 0.8
interpolate: True
stealthchop_threshold:0
[tmc2209 stepper_z]
uart_pin: PC5
run_current: 0.8
hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
[tmc2209 extruder]
uart_pin: PC4
run_current: 0.8
hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
[mcu rpi]
serial: /tmp/klipper_host_mcu
# [adxl345]
# cs_pin: rpi:None
# spi_bus: spidev0.2
# [resonance_tester]
# accel_chip: adxl345
# probe_points:
# 100, 100, 20 # an example
[force_move]
enable_force_move : true
[gcode_macro M109]
rename_existing: M99109
gcode:
#Parameters
{% if 'S' in params %}
{% set s = params.S|float %}
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
{% if printer[printer.toolhead.extruder].temperature >= s-4 %}
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
{% else %}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s-4} MAXIMUM={s+10}
{% endif %}
{% else %}
M104 S0
{% endif %}
[display_status]
[gcode_macro M17]
gcode:
{% if 'X' in params or 'Y' in params or 'Z' in params or 'E' in params %}
{% if 'X' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_x enable=1
{% endif %}
{% if 'Y' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_y enable=1
{% endif %}
{% if 'Z' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
{% endif %}
{% if 'E' in params %}
SET_STEPPER_ENABLE STEPPER=extruder enable=1
{% endif %}
{% else %}
SET_STEPPER_ENABLE STEPPER=stepper_x enable=1
SET_STEPPER_ENABLE STEPPER=stepper_y enable=1
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
#SET_STEPPER_ENABLE STEPPER=extruder enable=1
{% endif %}
[gcode_macro M84]
rename_existing:M84.1
gcode:
{% if 'X' in params or 'Y' in params or 'Z' in params or 'E' in params %}
{% if 'X' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
{% endif %}
{% if 'Y' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
{% endif %}
{% if 'Z' in params %}
SET_STEPPER_ENABLE STEPPER=stepper_z enable=0
{% endif %}
{% if 'E' in params %}
SET_STEPPER_ENABLE STEPPER=extruder enable=0
{% endif %}
{% else %}
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
SET_STEPPER_ENABLE STEPPER=stepper_z enable=0
SET_STEPPER_ENABLE STEPPER=extruder enable=0
{% endif %}
[delayed_gcode KINEMATIC_POSITION]
initial_duration:3.0
gcode:
SET_KINEMATIC_POSITION X=110
SET_KINEMATIC_POSITION Y=110
SET_KINEMATIC_POSITION Z=0
####################################################################
# Configuration related to partition heating
#####################################################################
[heater_generic heater_bed1]
gcode_id:M105
heater_pin:PC8
max_power:1.0
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin:PC2
#control = watermark
# 80C
# control = pid
# pid_Kp = 75.210
# pid_Ki = 1.385
# pid_Kd = 1020.975
# 70C
# control = pid
# pid_Kp = 75.100
# pid_Ki = 1.311
# pid_Kd = 1075.810
# pid_Kp=74.251 pid_Ki=1.105 pid_Kd=1247.425
# 65C
control = pid
pid_Kp = 74.251
pid_Ki = 1.105
pid_Kd = 1247.725
# DEFAULT
# control = pid
# pid_Kp = 70.591
# pid_Ki = 1.055
# pid_Kd = 1180.632
min_temp:0
max_temp:120
[verify_heater heater_bed1]
max_error: 600
check_gain_time:120
hysteresis: 10
heating_gain: 2
[gcode_macro M191]
gcode:
{% set s = (params.S|float,120)|min %}
{% if params.S is defined %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={s|int}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={s|int}
{% if printer.heater_bed.temperature <= s-2 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-2} MAXIMUM={s+10}
# G4 P20000
# {% else %}
# G4 P10000
{% endif %}
{% else %}
M140 S0
{% endif %}
[gcode_macro M190]
rename_existing: M99190
gcode:
{% set s = (params.S|float,120)|min %}
{% if params.S is defined %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={s|int}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={s|int}
{% if printer.heater_bed.temperature <= s-2 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-2} MAXIMUM={s+10}
# G4 P20000
# {% else %}
# G4 P10000
{% endif %}
{% else %}
M140 S0
{% endif %}
[gcode_macro M140]
rename_existing: M99140
gcode:
{% set s = (params.S|float,120)|min %}
{% if params.S is defined %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={s|int}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={s|int}
{% else %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET=0
{% endif %}
[gcode_macro M141]
gcode:
{% set s = (params.S|float,120)|min %}
{% if params.S is defined %}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET={s|int}
{% else %}
SET_HEATER_TEMPERATURE HEATER=heater_bed1 TARGET=0
{% endif %}
####################################################################
## G-code macro definition
#####################################################################
[gcode_macro M205]
description: Sets square corner velocity.
Usage: M205 [X<velocity>] [Y<velocity>]
gcode:
{% set max_square_corner_velocity = 30 %}
{% if 'X' in params or 'Y' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="{(params.X|default(0)|float, params.Y|default(0)|float,max_square_corner_velocity)|min}"
{% else %}
SET_VELOCITY_LIMIT
{% endif %}
[gcode_macro M203]
description: Sets maximum velocity.
Usage: M203 [X<velocity>] [Y<velocity>]
gcode:
{% if 'X' in params or 'Y' in params %}
{% set velocity = (params.X|default(params.Y)|float,
params.Y|default(params.X)|float,500)|min %}
SET_VELOCITY_LIMIT VELOCITY="{velocity}"
{% else %}
SET_VELOCITY_LIMIT
{% endif %}
[gcode_macro m600]
description: Pauses the current print.
Usage: M600 [B<beeps>] [E<pos>] [L<pos>] [R<temp>] [U<pos>] [X<pos>] [Y<pos>]
[Z<pos>]
gcode:
PAUSE P=2{% for k in params|select("in", "BEXYZ") %}{
' '~k~'="'~params[k]~'"'}{% endfor %}
################ Buzzer configuration ##################
[output_pin beeper]
pin: PA2
pwm: true
shutdown_value:0
value:0.0
[gcode_macro m300]
description: Emits and audible beep.
Usage: M300 [P<duration>] [S<frequency>]
gcode:
{% set settings = printer.configfile.settings %}
{% if "output_pin beeper" in printer %}
{% set P = (params.P|default(100)|int, 0)|max %}
{% set S = (params.S|default(1000)|int, 10000)|min %}
SET_PIN PIN=beeper VALUE={
settings["output_pin beeper"].scale|default(1.0) * 0.5
}{% if settings["output_pin beeper"].pwm %} CYCLE_TIME={
1.0 / S }{% endif %}
G4 P{P}
SET_PIN PIN=beeper VALUE=0
{% else %}
{action_respond_info(
"M300 is disabled. To enable create an [output_pin beeper] config.")}
{% endif %}
[gcode_arcs]
[exclude_object]
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh 11]
#*# version = 1
#*# points =
#*# -0.026250, -0.001250, 0.011250, 0.018750, 0.030000, 0.017500, 0.021250, 0.010000, 0.003750, 0.001250, -0.013750
#*# -0.037500, -0.015000, -0.016250, -0.001250, 0.013750, 0.013750, 0.022500, 0.018750, 0.008750, 0.006250, 0.002500
#*# -0.060000, -0.050000, -0.050000, -0.035000, -0.022500, -0.017500, -0.003750, -0.015000, -0.038750, -0.035000, -0.041250
#*# -0.030000, -0.025000, -0.027500, -0.017500, -0.003750, -0.010000, -0.011250, -0.033750, -0.053750, -0.070000, -0.081250
#*# -0.023750, -0.020000, -0.027500, -0.013750, 0.007500, -0.001250, -0.005000, -0.023750, -0.056250, -0.067500, -0.082500
#*# -0.037500, -0.036250, -0.035000, -0.018750, -0.003750, 0.000000, -0.011250, -0.040000, -0.058750, -0.063750, -0.081250
#*# -0.050000, -0.032500, -0.037500, -0.013750, -0.001250, 0.002500, 0.003750, -0.012500, -0.033750, -0.042500, -0.048750
#*# -0.042500, -0.023750, -0.022500, 0.000000, 0.008750, 0.005000, 0.003750, -0.011250, -0.031250, -0.037500, -0.051250
#*# -0.041250, -0.021250, -0.008750, 0.010000, 0.021250, 0.020000, 0.022500, 0.016250, 0.000000, -0.005000, -0.012500
#*# -0.043750, -0.017500, -0.017500, 0.005000, 0.011250, 0.006250, 0.013750, 0.001250, -0.006250, -0.016250, -0.018750
#*# -0.040000, -0.005000, 0.001250, 0.020000, 0.030000, 0.026250, 0.028750, 0.020000, 0.012500, 0.006250, -0.002500
#*# tension = 0.2
#*# min_x = 10.0
#*# algo = bicubic
#*# y_count = 11
#*# mesh_y_pps = 2
#*# min_y = 21.0
#*# x_count = 11
#*# max_y = 219.9
#*# mesh_x_pps = 2
#*# max_x = 200.0

79
Neptune4Pro/webcam.txt Normal file
View file

@ -0,0 +1,79 @@
### Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText.
### Do not use Notepad or WordPad.
### MacOSX users: If you use Textedit to edit this file make sure to use
### "plain text format" and "disable smart quotes" in "Textedit > Preferences"
### Configure which camera to use
#
# Available options are:
# - auto: tries first usb webcam, if that's not available tries raspi cam
# - usb: only tries usb webcam
# - raspi: only tries raspi cam
#
# Defaults to auto
#
camera="usb"
### Additional options to supply to MJPG Streamer for the USB camera
#
# See https://faq.octoprint.org/mjpg-streamer-config for available options
#
# Defaults to a resolution of 640x480 px and a framerate of 10 fps
#
camera_usb_options="-d /dev/video4 -r 640x480 -f 60 -ex 190 -q 90"
### Additional webcam devices known to cause problems with -f
#
# Apparently there a some devices out there that with the current
# mjpg_streamer release do not support the -f parameter (for specifying
# the capturing framerate) and will just refuse to output an image if it
# is supplied.
#
# The webcam daemon will detect those devices by their USB Vendor and Product
# ID and remove the -f parameter from the options provided to mjpg_streamer.
#
# By default, this is done for the following devices:
# Logitech C170 (046d:082b)
# GEMBIRD (1908:2310)
# Genius F100 (0458:708c)
# Cubeternet GL-UPC822 UVC WebCam (1e4e:0102)
#
# Using the following option it is possible to add additional devices. If
# your webcam happens to show above symptoms, try determining your cam's
# vendor and product id via lsusb, activating the line below by removing # and
# adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff"
#
# additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff")
#
#
#additional_brokenfps_usb_devices=()
### Additional options to supply to MJPG Streamer for the RasPi Cam
#
# See https://faq.octoprint.org/mjpg-streamer-config for available options
#
# Defaults to 10fps
#
#camera_raspi_options="-fps 10"
### Configuration of camera HTTP output
#
# Usually you should NOT need to change this at all! Only touch if you
# know what you are doing and what the parameters mean.
#
# Below settings are used in the mjpg-streamer call like this:
#
# -o "output_http.so -w $camera_http_webroot $camera_http_options"
#
# Current working directory is the mjpg-streamer base directory.
#
#camera_http_webroot="./www-mainsail"
#camera_http_options="-n"
### EXPERIMENTAL
# Support for different streamer types.
#
# Available options:
# mjpeg [default] - stable MJPG-streamer
#camera_streamer=mjpeg