Advertisement
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
- microsteps: 16
- rotation_distance: 40
- endstop_pin = ^!ar3
- position_min = -5
- position_endstop = -5
- position_max = 210
- 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
- microsteps: 16
- rotation_distance: 40
- endstop_pin = ^!ar42
- position_endstop = 0
- position_max = 210
- 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
- microsteps: 16
- rotation_distance: 8
- ## uncomment below for 3dtouch. comment for mannual mesh bed leveling
- #endstop_pin = probe:z_virtual_endstop
- ## comment 2 lines below for 3dtouch bed leveling and to disable Z limit switches
- endstop_pin = ^!ar18
- position_endstop = 0.0
- position_max = 205
- homing_speed = 10
- homing_retract_dist = 5
- second_homing_speed = 3
- [stepper_z1]
- step_pin = ar36
- dir_pin = ar34
- ## comment below for 3dtouch bed leveling and to disable Z limit switches
- endstop_pin = ^!ar43
- enable_pin = !ar30
- #step_distance = .0025
- microsteps: 16
- rotation_distance: 8
- [extruder]
- step_pin = ar26
- dir_pin = ar28
- enable_pin = !ar24
- control = pid
- ## original extruder stepper motor
- #step_distance = .00247
- microsteps: 16
- rotation_distance: 7.495
- ## NEMA17 23mm stepper motor
- #step_distance = .00236
- 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
- #pin_map = arduino
- [printer]
- kinematics = cartesian
- max_velocity = 300
- max_accel = 4000
- 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
- ## do your own measurement
- #x_offset = 20
- #y_offset = -14
- #z_offset = 1.17
- [safe_z_home]
- home_xy_position = 100,100
- speed = 150
- 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
- ## manual mesh bed leveling
- [bed_mesh]
- speed = 50
- horizontal_move_z = 5
- mesh_min = 30,30
- mesh_max = 180,180
- probe_count = 5,5
- fade_start = 1.0
- fade_end = 10.0
- # enable moving befor homing
- ## put in terminal:
- ## SET_KINEMATIC_POSITION X=100 Y=100 Z=100
- ## then move as usual
- [force_move]
- enable_force_move: True
- [virtual_sdcard]
- path: ~/.octoprint/uploads/
- [output_pin BEEPER_pin]
- pin: ar31
- pwm: True
- value: 0
- shutdown_value: 0
- cycle_time: 0.001
- scale: 1000
- [gcode_macro M300]
- #default_parameter_S: 1000
- #default_parameter_P: 100
- gcode:
- {% set S = params.S|default(1000) %}
- {% set P = params.P|default(100) %}
- SET_PIN PIN=BEEPER_pin VALUE={S}
- G4 P{P}
- SET_PIN PIN=BEEPER_pin VALUE=0
- [display_status]
- # change filament
- [pause_resume]
- [gcode_macro M600]
- #default_parameter_X: 50
- #default_parameter_Y: 0
- #default_parameter_Z: 10
- gcode:
- {% set X = params.X|default(50) %}
- {% set Y = params.Y|default(0) %}
- {% set Z = params.Z|default(10) %}
- 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-150 F1000
- M300 S299 P200
- M300 S299 P200
- M300 S299 P200
- M300 S299 P200
- M300 S299 P200
- RESTORE_GCODE_STATE NAME=M600_state
- [gcode_macro PAUSE]
- rename_existing: BASE_PAUSE
- # 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 #####
- SAVE_GCODE_STATE NAME=PAUSE_state
- BASE_PAUSE
- G91
- G1 E-{E} F2100
- G1 Z{z_safe} F900
- G90
- G1 X{x_park} Y{y_park} F6000
- [gcode_macro RESUME]
- rename_existing: BASE_RESUME
- gcode:
- ##### read E from pause macro #####
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- ##### end of definitions #####
- G91
- G1 E{E} F2100
- RESTORE_GCODE_STATE NAME=PAUSE_state
- BASE_RESUME
- [gcode_macro CANCEL_PRINT]
- rename_existing: BASE_CANCEL_PRINT
- gcode:
- TURN_OFF_HEATERS
- CLEAR_PAUSE
- SDCARD_RESET_FILE
- BASE_CANCEL_PRINT
- [gcode_macro START_PRINT]
- gcode:
- {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
- {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
- G21 #metric values
- G90 #absolute positioning
- M82 #set extruder to absolute mode
- M107 #start with the fan off
- M190 S{BED_TEMP} #preheat and wait for bed
- M109 S{EXTRUDER_TEMP} #preheat and wait for hotend
- M300 S1000 P500 #BEEP heating done
- G28 X0 Y10 Z0 #move X/Y to min endstops
- M420 S1 #Enable leveling
- M420 Z5.0 #Set leveling fading height to 5 mm
- G0 Z0.15 #lift nozzle a bit
- G0 Y10 #move 10mm in Y to prevent a crash with bed clips
- G92 E0 #zero the extruded length
- G1 X50 E50 F500 #Extrude 50mm of filament in a 5cm line.
- G92 E0 #zero the extruded length again
- G1 E-3 F500 #Retract a little
- G1 X120 F4000 #Quickly wipe away from the filament line
- # 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:
- M104 S0 #Extruder off
- M140 S0 #Heatbed off
- M107 #Fan off
- G91 #relative positioning
- G1 E-5 F300 #retract a little
- G1 Z+10 #lift print head
- G28 X0 Y0 #homing
- G1 Y180 F2000 #reset feedrate
- M84 #disable stepper motors
- G90 #absolute positioning
- M300 S440 P200 #Make Print Completed Tones
- M300 S660 P250 #beep
- M300 S880 P300 #beep
- # Turn off bed, extruder, and fan
- #M140 S0
- #M104 S0
- #M106 S0
- # Move nozzle away from print while retracting
- #G91
- #G1 X-2 Y-2 E-3 F300
- # Raise nozzle by 10mm
- #G1 Z10 F3000
- #G90
- # Disable steppers
- #M84
- ## for Measuring Resonances through Raspberry pi
- ## https://www.klipper3d.org/Measuring_Resonances.html
- #[mcu rpi]
- #serial = /tmp/klipper_host_mcu
- #[adxl345]
- #cs_pin: rpi:None
- #[resonance_tester]
- #accel_chip: adxl345
- #probe_points:
- # 100,100,20 # an example
- #*# <---------------------- SAVE_CONFIG ---------------------->
- #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
- #*#
- #*# [heater_bed]
- #*# pid_kp = 73.627
- #*# pid_ki = 3.272
- #*# pid_kd = 414.154
- #*# control = pid
- #*#
- #*# [bed_mesh default]
- #*# version = 1
- #*# points =
- #*# 0.082500, 0.032500, 0.005000, 0.030000
- #*# 0.072500, -0.007500, -0.002500, -0.012500
- #*# 0.077500, 0.027500, -0.007500, 0.017500
- #*# 0.077500, 0.030000, 0.002500, 0.007500
- #*# tension = 0.2
- #*# min_x = 23.0
- #*# algo = bicubic
- #*# y_count = 4
- #*# mesh_y_pps = 2
- #*# min_y = 28.0
- #*# x_count = 4
- #*# max_y = 190.0
- #*# mesh_x_pps = 2
- #*# max_x = 189.97
- #*#
- #*# [input_shaper]
- #*# shaper_type_x = 3hump_ei
- #*# shaper_freq_x = 73.0
- #*# shaper_type_y = 3hump_ei
- #*# shaper_freq_y = 60.0
- #*#
- #*# [extruder]
- #*# control = pid
- #*# pid_kp = 26.839
- #*# pid_ki = 1.612
- #*# pid_kd = 111.716
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement