956 lines
31 KiB
INI
956 lines
31 KiB
INI
# #############################################################################################################################
|
|
#
|
|
# NEPTUNE 4 PRO With Stepper BJ42D22-53V04
|
|
#
|
|
# #############################################################################################################################
|
|
|
|
# This version of the printer.cfg of the Neptune 4 has been improved by SmartHome42/Printernbeer (Julien Mairy)
|
|
#
|
|
# YouTube : https://www.youtube.com/@printernbeer GitHub : https://github.com/mairyj/
|
|
# Facebook page : https://www.facebook.com/Smarthome42 Cults3D : https://cults3d.com/fr/utilisateurs/mairyjulien/
|
|
# Instagram : https://www.instagram.com/mairyjulien/ Printables : https://www.printables.com/@JulienMairy_174899
|
|
# TikTok : https://www.tiktok.com/@julienmairy Makerworld : https://makerworld.com/en/@mairyjulien
|
|
# Special thanks for Tom's Basement for your help : https://www.youtube.com/@TomsBasement | Foxtrot Quebec and Romain Tassus
|
|
#
|
|
# #############################################################################################################################
|
|
#
|
|
# For a possible update check here: https://github.com/mairyj/Elegoo-Neptune-4-Series/tree/main/Neptune%204%20Pro
|
|
#
|
|
# This version is based on the official version 1.1.2.53 and was released on May 11, 2024
|
|
#
|
|
# #############################################################################################################################
|
|
#
|
|
# This file contains common pin mappings for MKS SKIPR
|
|
# boards. To use this config, the firmware should be compiled for the
|
|
# stm32f407. When running "make menuconfig", select the 48KiB
|
|
# bootloader, and enable "Serial for communication" and select the "on USART1 PA10/PA9"
|
|
#
|
|
# The "make flash" command does not work on the MKS SKIPR. Instead,
|
|
# after running "make", copy the generated "out/klipper.bin" file to a
|
|
# file named "mks_skipr.bin" on an SD card and then restart the
|
|
# MKS SKIPR with that SD card.
|
|
#
|
|
# See docs/Config_Reference.md for a description of parameters.
|
|
#
|
|
# #############################################################################################################################
|
|
# #############################################################################################################################
|
|
#
|
|
# INDEX LINE
|
|
#
|
|
# Base Config 63
|
|
# Temperature 103
|
|
# X/Y/Z Stepper Settings 117
|
|
# TMC UART configuration 172
|
|
# Extruder 204
|
|
# Bed Heater 250
|
|
# Fan Control 272
|
|
# Acceleration sensor (ADXL345/resonance_tester) 290
|
|
# Homing and Gantry Adjustment Routines 325
|
|
# Probe 390
|
|
# Led Control 418
|
|
# Filament Sensor 478
|
|
# Macros START / END / PAUSE / RESUME / CANCEL 491
|
|
# Macros Change Filament 649
|
|
# Macros Load / Unload Filament 661
|
|
# Macros PID 689
|
|
# Macros Other 704
|
|
# Other 858
|
|
# Buzzer configuration 888
|
|
# CONFIG BED 2 917
|
|
# Bed Mesh Area 942
|
|
#
|
|
#####################################################################
|
|
# Base Config
|
|
#####################################################################
|
|
|
|
[include plr.cfg]
|
|
|
|
[mcu]
|
|
# The hardware use USART1 PA10/PA9 connect to RK3328
|
|
serial: /dev/ttyS0
|
|
restart_method: command
|
|
|
|
[printer]
|
|
kinematics:cartesian
|
|
max_velocity: 500
|
|
max_accel: 5000
|
|
max_accel_to_decel: 4000 # Original Value 2500
|
|
max_z_velocity: 20
|
|
max_z_accel: 200 # Original Value 100
|
|
square_corner_velocity: 9.0
|
|
|
|
[mcu rpi]
|
|
serial: /tmp/klipper_host_mcu
|
|
|
|
[virtual_sdcard]
|
|
path: ~/gcode_files
|
|
path: ~/gcode_files
|
|
on_error_gcode:
|
|
# test OK
|
|
G91
|
|
G1 Z25 F900
|
|
G90
|
|
TURN_OFF_HEATERS
|
|
M106 S100
|
|
M84 X Y E
|
|
M300 P10000 S1
|
|
G4 P300
|
|
M300
|
|
M300
|
|
M300
|
|
|
|
#####################################################################
|
|
# Temperature
|
|
#####################################################################
|
|
|
|
[temperature_sensor mcu_temp]
|
|
sensor_type: temperature_mcu
|
|
min_temp: 0
|
|
max_temp: 100
|
|
|
|
[temperature_sensor Host]
|
|
sensor_type: temperature_host
|
|
min_temp: 10
|
|
max_temp: 100
|
|
|
|
#####################################################################
|
|
# X/Y/Z Stepper Settings
|
|
#####################################################################
|
|
|
|
[stepper_x]
|
|
step_pin:PC14
|
|
dir_pin:PC13
|
|
enable_pin:!PC15
|
|
microsteps: 64 # Original Value 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
|
|
step_pulse_duration:0.000002
|
|
|
|
[stepper_y]
|
|
step_pin:PB4
|
|
dir_pin:PB3
|
|
enable_pin:!PB5
|
|
microsteps: 64 # Original Value 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
|
|
step_pulse_duration:0.000002
|
|
|
|
[stepper_z]
|
|
step_pin:PC10
|
|
dir_pin:!PA15
|
|
enable_pin: !PC11
|
|
microsteps: 64 # Original Value 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
|
|
second_homing_speed: 3
|
|
homing_retract_dist: 5
|
|
|
|
########################################
|
|
# TMC UART configuration
|
|
########################################
|
|
|
|
[tmc2209 stepper_x]
|
|
uart_pin: PB9
|
|
run_current: 0.9 # original value 1.2
|
|
#hold_current: 0.4
|
|
interpolate: false # original value false
|
|
stealthchop_threshold: 999999 # original value 0
|
|
|
|
[tmc2209 stepper_y]
|
|
uart_pin: PD2
|
|
run_current: 0.9 # original value 1.2
|
|
#hold_current: 0.4
|
|
interpolate: false # original value false
|
|
stealthchop_threshold: 999999 # original value 0
|
|
|
|
[tmc2209 stepper_z]
|
|
uart_pin: PC5
|
|
run_current: 0.7 # original value 0.8
|
|
#hold_current: 0.5
|
|
interpolate: false # original value false
|
|
stealthchop_threshold: 999999
|
|
|
|
[tmc2209 extruder]
|
|
uart_pin: PC4
|
|
run_current: 0.8
|
|
#hold_current: 0.5
|
|
interpolate: false # original value false
|
|
stealthchop_threshold: 999999
|
|
|
|
#####################################################################
|
|
# Extruder
|
|
#####################################################################
|
|
|
|
[extruder]
|
|
step_pin:PA5
|
|
dir_pin:!PA6
|
|
enable_pin:!PA4
|
|
microsteps:64 # Original Value 16
|
|
rotation_distance: 28.888 #31.4 #Bondtech 5mm Drive Gears
|
|
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
|
|
control :pid
|
|
pid_kp : 26.213
|
|
pid_ki : 1.304
|
|
pid_kd : 131.721
|
|
pressure_advance: 0.012 # Original Value 0.020
|
|
pressure_advance_smooth_time: 0.01
|
|
instantaneous_corner_velocity: 2.5 # Original Value 10.0 (for my original config)
|
|
max_extrude_only_distance: 300.0
|
|
max_extrude_only_velocity: 60 # Original Value 5000 (for my original config)
|
|
max_extrude_only_accel:5000
|
|
step_pulse_duration:0.000002 # no in the elegoo file
|
|
max_extrude_cross_section: 50 # Original Value 99
|
|
min_extrude_temp: 100
|
|
|
|
[firmware_retraction]
|
|
retract_length: 0.5
|
|
retract_speed: 55
|
|
unretract_extra_length: 0.05
|
|
unretract_speed: 60
|
|
|
|
[verify_heater extruder]
|
|
max_error: 120
|
|
check_gain_time:120 # Original Value 30
|
|
hysteresis: 10
|
|
heating_gain: 2
|
|
|
|
#####################################################################
|
|
# Bed Heater
|
|
#####################################################################
|
|
|
|
[heater_bed]
|
|
heater_pin:PB10
|
|
sensor_type: NTC 100K MGB18-104F39050L32
|
|
sensor_pin: PA0
|
|
max_power: 1.0
|
|
control: pid # Original Value control: watermark
|
|
pid_kp: 64.367 #############################################
|
|
pid_ki: 0.804 #/!\ For better optimization redo the PIDs/!\
|
|
pid_kd: 1288.956 #############################################
|
|
min_temp: 0 # Original Value -80
|
|
max_temp: 120 # Original Value 200
|
|
|
|
[verify_heater heater_bed]
|
|
max_error: 120
|
|
check_gain_time:120
|
|
hysteresis: 10
|
|
heating_gain: 2 # Original Value 1
|
|
|
|
#####################################################################
|
|
# Fan Control
|
|
#####################################################################
|
|
|
|
#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
|
|
|
|
#####################################################################
|
|
# Acceleration sensor
|
|
#####################################################################
|
|
|
|
#[include PIS.cfg]
|
|
|
|
[input_shaper]
|
|
shaper_freq_x: 66.66 #68.4
|
|
shaper_freq_y: 42.05 #45.6
|
|
shaper_type_x: mzv
|
|
shaper_type_y: ei
|
|
|
|
#[adxl345]
|
|
#cs_pin: rpi:None
|
|
#spi_bus: spidev0.2
|
|
|
|
#[resonance_tester]
|
|
#accel_chip: adxl345
|
|
#probe_points:
|
|
# 115, 115, 50
|
|
|
|
[gcode_macro INPUT_SHAPER_Y]
|
|
gcode:
|
|
G28
|
|
G1 Z50 F500
|
|
SHAPER_CALIBRATE AXIS=Y
|
|
SAVE_CONFIG
|
|
|
|
[gcode_macro INPUT_SHAPER_X]
|
|
gcode:
|
|
G28
|
|
G1 Z50 F500
|
|
SHAPER_CALIBRATE AXIS=X
|
|
SAVE_CONFIG
|
|
|
|
####################################################################
|
|
# Homing and Gantry Adjustment Routines
|
|
#####################################################################
|
|
|
|
[idle_timeout]
|
|
timeout: 7200
|
|
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,98 # Change coordinates to the center of your print bed
|
|
speed: 200
|
|
z_hop: 10 # Move up 10mm
|
|
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
|
|
|
|
[screws_tilt_adjust] # Gives the palpation values on the bed and indicates the changes to be made.
|
|
screw1: 141, 98
|
|
screw1_name: center ################################
|
|
screw2: 56.75, 12.05 # #
|
|
screw2_name: front left screw # 5 4 #
|
|
screw3: 226.75, 12.05 # #
|
|
screw3_name: front right screw # 1 #
|
|
screw4: 226.75, 182.05 # #
|
|
screw4_name: rear right screw # 2 3 #
|
|
screw5: 56.75, 182.05 # #
|
|
screw5_name: rear left screw ################################
|
|
horizontal_move_z: 10.0
|
|
speed: 150.0
|
|
screw_thread: CW-M4
|
|
|
|
[bed_screws] # Place the nozzle at the screws to make manual adjustments
|
|
screw1: 32.5, 32.5
|
|
screw1_name: front left screw ################################
|
|
screw2: 202.5, 32.5 # #
|
|
screw2_name: front right screw # 4 3 #
|
|
screw3: 202.5, 202.5 # #
|
|
screw3_name: rear right screw # #
|
|
screw4: 32.5, 202.5 # #
|
|
screw4_name: rear left screw # 1 2 #
|
|
horizontal_move_z: 10.0 # #
|
|
speed: 150.0 ################################
|
|
|
|
#####################################################################
|
|
# Probe
|
|
#####################################################################
|
|
|
|
[probe]
|
|
pin:^PA11
|
|
x_offset: -24.25
|
|
y_offset: 20.45
|
|
z_offset: 0.0
|
|
speed: 10.0
|
|
samples: 2
|
|
samples_result: median
|
|
sample_retract_dist: 3.0
|
|
samples_tolerance: 0.05
|
|
samples_tolerance_retries: 5
|
|
|
|
[bed_mesh]
|
|
speed:120
|
|
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 #before original value 4, 4
|
|
fade_start:1.0 #before original value 1.0
|
|
fade_end:30.0 #before original value 10.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.
|
|
|
|
[gcode_macro ALL_LIGHTS]
|
|
description: Turn LEDs on/off
|
|
gcode:
|
|
RUN_SHELL_COMMAND CMD=FLASHLIGHT
|
|
RUN_SHELL_COMMAND CMD=MODLELIGHT
|
|
|
|
#####################################################################
|
|
# Filament sensor
|
|
#####################################################################
|
|
|
|
[filament_switch_sensor fila]
|
|
pause_on_runout: True
|
|
runout_gcode:
|
|
PAUSE
|
|
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
|
|
event_delay: 3.0
|
|
pause_delay: 1.0
|
|
switch_pin: PA12
|
|
|
|
#####################################################################
|
|
# Macros START / END / PAUSE / RESUME / CANCEL
|
|
#####################################################################
|
|
|
|
[gcode_macro PRINT_START]
|
|
gcode:
|
|
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=True
|
|
G92 E0
|
|
G90
|
|
#SET_INPUT_SHAPER SHAPER_TYPE=ei
|
|
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 %} # If the current gcode-Z position is less than the maximum limit position
|
|
G90 # absolute positioning
|
|
G1 Z{z+5} F6000 # park nozzle at rear
|
|
{% endif %}
|
|
TURN_OFF_HEATERS
|
|
M107
|
|
M84 X Y E
|
|
|
|
[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 E50 F200
|
|
G4 P2000
|
|
G1 X20 F15000
|
|
G1 X-20
|
|
G1 X20
|
|
G1 X-20
|
|
G1 X20
|
|
G1 X-20
|
|
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
|
|
|
|
[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
|
|
|
|
#####################################################################
|
|
# Macros Change Filament
|
|
#####################################################################
|
|
|
|
[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 %}
|
|
|
|
#####################################################################
|
|
# Macros Load / Unload Filament
|
|
#####################################################################
|
|
|
|
[gcode_macro UNLOAD_FILAMENT] #unload filament
|
|
gcode:
|
|
G91
|
|
# G1 E10 F300
|
|
G1 E-80 F800
|
|
G90
|
|
|
|
[gcode_macro LOAD_FILAMENT] #load filament
|
|
gcode:
|
|
G91
|
|
G1 E20 F800
|
|
G1 E60 F300
|
|
G90
|
|
|
|
#####################################################################
|
|
# Macros PID
|
|
#####################################################################
|
|
|
|
[gcode_macro PID_EXTRUDER]
|
|
gcode:
|
|
G28
|
|
M106 S255
|
|
PID_CALIBRATE HEATER=extruder TARGET=220
|
|
SAVE_CONFIG
|
|
|
|
[gcode_macro PID_BED]
|
|
gcode:
|
|
G28
|
|
M106 S255
|
|
PID_CALIBRATE HEATER=heater_bed TARGET=60
|
|
SAVE_CONFIG
|
|
|
|
[gcode_macro PID_BED2]
|
|
gcode:
|
|
G28
|
|
M106 S255
|
|
PID_CALIBRATE HEATER=heater_bed1 TARGET=60
|
|
SAVE_CONFIG
|
|
|
|
#####################################################################
|
|
# Macros Other
|
|
#####################################################################
|
|
|
|
[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 %}
|
|
|
|
[gcode_macro M109]
|
|
rename_existing: M99109
|
|
gcode:
|
|
#Parameters
|
|
{% set s = params.S|float %}
|
|
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set hotend temp
|
|
{% if s != 0 %}
|
|
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1} ; Wait for hotend temp (within 1 degree)
|
|
{% 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 %}
|
|
|
|
[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 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 m201]
|
|
description: Sets maximum accelleration.
|
|
Usage: M201 [X<accel>] [Y<accel>]
|
|
variable_max_accel: 1.7976931348623157e+308
|
|
gcode:
|
|
{% if 'X' in params or 'Y' in params %}
|
|
{% set accel = (params.X|default(params.Y)|float,
|
|
params.Y|default(params.X)|float)|min %}
|
|
SET_GCODE_VARIABLE MACRO=m201 VARIABLE=max_accel VALUE="{accel}"
|
|
{% if accel < printer.toolhead.max_accel %}
|
|
SET_VELOCITY_LIMIT ACCEL="{accel
|
|
}" ACCEL_TO_DECEL="{accel * 1}"
|
|
{% endif %}
|
|
{% 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 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 %}
|
|
|
|
#####################################################################
|
|
# Other
|
|
#####################################################################
|
|
|
|
[display_status]
|
|
|
|
[delayed_gcode KINEMATIC_POSITION]
|
|
initial_duration:3.0
|
|
gcode:
|
|
|
|
SET_KINEMATIC_POSITION X=110
|
|
SET_KINEMATIC_POSITION Y=110
|
|
SET_KINEMATIC_POSITION Z=0
|
|
|
|
[gcode_arcs]
|
|
resolution: 0.1
|
|
|
|
[exclude_object]
|
|
|
|
[respond]
|
|
default_type: echo
|
|
default_prefix: echo:
|
|
|
|
[print_stats]
|
|
|
|
[gcode_move]
|
|
|
|
[force_move]
|
|
enable_force_move : true
|
|
|
|
#####################################################################
|
|
# 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 %}
|
|
|
|
####################################################################
|
|
# CONFIG BED 2
|
|
#####################################################################
|
|
|
|
[heater_generic heater_bed1]
|
|
gcode_id:M105
|
|
#The ID used when querying temperature using M105.
|
|
#This parameter must be provided.
|
|
heater_pin:PC8
|
|
max_power:1.0
|
|
sensor_type: NTC 100K MGB18-104F39050L32
|
|
sensor_pin:PC2
|
|
control: pid
|
|
pid_Kp: 70.591 #############################################
|
|
pid_Ki: 1.055 #/!\ For better optimization redo the PIDs/!\
|
|
pid_Kd: 1180.632 #############################################
|
|
min_temp: -5
|
|
max_temp: 120
|
|
|
|
[verify_heater heater_bed1] # Heating block temperature tolerance configuration
|
|
max_error: 600 # Maximum error
|
|
check_gain_time:120 # Tolerance time
|
|
hysteresis: 10 # tolerance temperature
|
|
heating_gain: 2 # Heating gain
|
|
|
|
#####################################################################
|
|
# Bed Mesh Area
|
|
#####################################################################
|
|
# All Credit ChipCE : https://gist.github.com/ChipCE/95fdbd3c2f3a064397f9610f915f7d02
|
|
#
|
|
# This macro will dynamically changing the bed mesh area based on the size of the parts will be printed.
|
|
# The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)
|
|
#
|
|
# Cette macro modifiera dynamiquement la zone de maillage du lit en fonction de la taille des pièces à imprimer.
|
|
# Le fw sondera uniquement la zone sur laquelle la pièce sera imprimée (plus la valeur mesh_area_offset)
|
|
#
|
|
# Pour que cette macro fonctionne vous devez modifier votre START GCODE (voir dans le dossier de l'imprimante sur mon github):
|
|
# For this macro to work you need to modify your START GCODE (see in the printer folder on my github):
|
|
# https://github.com/mairyj/Elegoo-Neptune-4-Series/tree/main
|
|
|
|
#[include bed_mesh_area.cfg] |