Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Klipper configuration file for Anycubic i3 MEGA S
- #
- # This config file contains settings of all printer pins (steppers, sensors) for Anycubic i3 mega S in the factory configuration
- # Klipper firmware should be compiled for the atmega2560
- #
- # Config file includes
- # - Original or 2208(2209) rotated by cabel drivers
- # - Mesh bed leveling: BLtouch (3DTouch sensor from Triangelab)
- # - Manual meshed bed leveling (commented out)
- # - 'virtual_sdcard' for fast printing without gaps
- # - Beeper through M300 gcode
- # - Pause/Resume through M600 for filament change
- #
- # Home position is determined by 3DTouch. Z limit switches are not used.
- #
- # The latest version of the config reference is also available online at:
- # https://www.klipper3d.org/Config_Reference.html
- [stepper_x]
- step_pin = ar54
- dir_pin = ar55
- enable_pin = !ar38
- #step_distance = .0125
- rotation_distance = 40
- microsteps = 16
- full_steps_per_rotation = 200
- endstop_pin = ^!ar3
- position_min = -5
- position_endstop = -5
- position_max = 216
- homing_speed = 30
- homing_retract_dist = 5
- second_homing_speed = 10
- [stepper_y]
- step_pin = ar60
- dir_pin = !ar61
- enable_pin = !ar56
- #step_distance = .0125
- rotation_distance = 40
- microsteps = 16
- full_steps_per_rotation = 200
- endstop_pin = ^!ar42
- position_endstop = 0
- position_max = 217
- homing_speed = 50
- homing_retract_dist = 5
- second_homing_speed = 10
- [stepper_z]
- step_pin = ar46
- dir_pin = !ar48
- enable_pin = !ar62
- # step_distance = .0025
- rotation_distance = 2
- microsteps = 16
- full_steps_per_rotation = 200
- ## for 3dtouch. comment for mannual mesh bed leveling
- endstop_pin = probe:z_virtual_endstop
- ## uncomment below for manual mesh bed leveling and to enable Z limit switches
- endstop_pin = ^!ar18
- position_endstop = 0.0
- position_max = 160
- position_min = -0.09
- homing_speed = 10
- homing_retract_dist = 5
- second_homing_speed = 3
- [stepper_z1]
- step_pin = ar36
- dir_pin = !ar34
- ## uncomment below for manual mesh bed leveling and to enable Z limit switches
- endstop_pin = ^!ar43
- enable_pin = !ar30
- rotation_distance = 2
- microsteps = 16
- full_steps_per_rotation = 200
- [extruder]
- step_pin = ar26
- dir_pin = !ar28
- enable_pin = !ar24
- rotation_distance = 7.740
- microsteps = 16
- full_steps_per_rotation = 200
- nozzle_diameter = 0.400
- filament_diameter = 1.750
- heater_pin = ar10
- sensor_type = ATC Semitec 104GT-2
- sensor_pin = analog13
- min_temp = 0
- max_temp = 285
- max_extrude_only_distance = 150.0
- smooth_time = 1
- min_extrude_temp = 180
- pressure_advance = 0.1
- max_extrude_cross_section = 150
- [heater_fan extruder_fan]
- pin = ar44
- [heater_bed]
- heater_pin = ar8
- sensor_type = EPCOS 100K B57560G104F
- sensor_pin = analog14
- min_temp = 0
- max_temp = 110
- smooth_time = 1
- control = pid
- [fan]
- pin = ar9
- [mcu]
- serial = /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
- [printer]
- kinematics = cartesian
- max_velocity = 300
- max_accel = 1500
- max_accel_to_decel = 1500
- max_z_velocity = 7
- max_z_accel = 190
- square_corner_velocity = 5
- ## do your own measurement
- ## https://www.klipper3d.org/Resonance_Compensation.html
- #[input_shaper]
- #shaper_type_x = 3hump_ei
- #shaper_freq_x = 73.0
- #shaper_type_y = 3hump_ei
- #shaper_freq_y = 60.0
- [heater_fan stepstick_fan]
- pin = ar7
- [bltouch]
- sensor_pin = ^ar2
- control_pin = ar11
- x_offset = 21.00
- y_offset = -17.00
- z_offset = 0.43
- # M851 X21.00 Y-17.00 Z-0.43
- [safe_z_home]
- home_xy_position = 108,108.5
- speed = 100
- z_hop = 5
- z_hop_speed = 10
- ## bltouch mesh bed leveling
- [bed_mesh]
- speed = 200
- horizontal_move_z = 5
- mesh_min = 23,28
- mesh_max = 190,190
- probe_count = 4,4
- fade_start = 1.0
- fade_end = 10.0
- algorithm = bicubic
- # Arduino aliases for atmega2560/1280 (Arduino mega) boards
- [board_pins arduino-mega]
- aliases:
- ar0=PE0, ar1=PE1, ar2=PE4, ar3=PE5, ar4=PG5,
- ar5=PE3, ar6=PH3, ar7=PH4, ar8=PH5, ar9=PH6,
- ar10=PB4, ar11=PB5, ar12=PB6, ar13=PB7, ar14=PJ1,
- ar15=PJ0, ar16=PH1, ar17=PH0, ar18=PD3, ar19=PD2,
- ar20=PD1, ar21=PD0, ar22=PA0, ar23=PA1, ar24=PA2,
- ar25=PA3, ar26=PA4, ar27=PA5, ar28=PA6, ar29=PA7,
- ar30=PC7, ar31=PC6, ar32=PC5, ar33=PC4, ar34=PC3,
- ar35=PC2, ar36=PC1, ar37=PC0, ar38=PD7, ar39=PG2,
- ar40=PG1, ar41=PG0, ar42=PL7, ar43=PL6, ar44=PL5,
- ar45=PL4, ar46=PL3, ar47=PL2, ar48=PL1, ar49=PL0,
- ar50=PB3, ar51=PB2, ar52=PB1, ar53=PB0, ar54=PF0,
- ar55=PF1, ar56=PF2, ar57=PF3, ar58=PF4, ar59=PF5,
- ar60=PF6, ar61=PF7, ar62=PK0, ar63=PK1, ar64=PK2,
- ar65=PK3, ar66=PK4, ar67=PK5, ar68=PK6, ar69=PK7,
- analog0=PF0, analog1=PF1, analog2=PF2, analog3=PF3, analog4=PF4,
- analog5=PF5, analog6=PF6, analog7=PF7, analog8=PK0, analog9=PK1,
- analog10=PK2, analog11=PK3, analog12=PK4, analog13=PK5, analog14=PK6,
- analog15=PK7,
- # Marlin adds these additional aliases
- ml70=PG4, ml71=PG3, ml72=PJ2, ml73=PJ3, ml74=PJ7,
- ml75=PJ4, ml76=PJ5, ml77=PJ6, ml78=PE2, ml79=PE6,
- ml80=PE7, ml81=PD4, ml82=PD5, ml83=PD6, ml84=PH2,
- ml85=PH7
- [force_move]
- enable_force_move: True
- [virtual_sdcard]
- path: /home/pi/gcode_files/
- [output_pin BEEPER_pin]
- pin: ar31
- pwm: True
- value: 0
- shutdown_value: 0
- cycle_time: 0.001
- scale: 1000
- [gcode_macro M300]
- gcode:
- # Use a default 1kHz tone if S is omitted.
- {% set S = params.S|default(1000)|int %}
- # Use a 10ms duration is P is omitted.
- {% set P = params.P|default(100)|int %}
- SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
- G4 P{P}
- SET_PIN PIN=BEEPER_pin VALUE=0
- [gcode_macro START_PRINT]
- gcode:
- {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
- {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(230)|float %}
- # Start bed heating
- M140 S{BED_TEMP}
- # Use absolute coordinates
- G90
- # Reset the G-Code Z offset (adjust Z offset if needed)
- #SET_GCODE_OFFSET Z=0.0
- # Home the printer
- G28
- # Move the nozzle near the bed
- G1 Z5 F3000
- # Move the nozzle very close to the bed
- G1 Z0.15 F300
- # Wait for bed to reach temperature
- M190 S{BED_TEMP}
- # Set and wait for nozzle to reach temperature
- M109 S{EXTRUDER_TEMP}
- [gcode_macro END_PRINT]
- gcode:
- # Turn off bed, extruder, and fan
- M140 S0
- M104 S0
- M106 S0
- # Move nozzle away from print while retracting
- G91
- G1 E-1 F300
- G1 Z+0.5 E-0.5
- G28 X0
- G1 Y180 F2000
- M300 S440 P200
- M300 S660 P250
- M300 S880 P300
- G90
- # Disable steppers
- M84
- [pause_resume]
- [gcode_macro M600]
- gcode:
- {% set X = params.X|default(50)|float %}
- {% set Y = params.Y|default(0)|float %}
- {% set Z = params.Z|default(10)|float %}
- SAVE_GCODE_STATE NAME=M600_state
- PAUSE
- G91
- G1 E-.8 F2700
- G1 Z{Z}
- G90
- G1 X{X} Y{Y} F3000
- G91
- G1 E-50 F1000
- RESTORE_GCODE_STATE NAME=M600_state
- [display_status]
- [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}
- [gcode_macro CANCEL_PRINT]
- description: Cancel the actual running print
- rename_existing: CANCEL_PRINT_BASE
- gcode:
- TURN_OFF_HEATERS
- CANCEL_PRINT_BASE
Advertisement
Add Comment
Please, Sign In to add comment