-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprinter.cfg
447 lines (391 loc) · 15 KB
/
printer.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# BLV mgn Cube 3D Printer By Ben Levi - KLIPPER
# This file contains common pin mappings for Duet2 Eth/Wifi boards.
# To use this config, the firmware should be compiled for the SAM4E8E.
# This Config file was adapted for BLV mgn Cube 3D printer By Ben Levi - https://www.blvprojects.com
# BLV mgn Cube 3D printer - FYSETC FULL KIT
# BLV Metal KIT
# Dual z true leveling (triple z soon..) Z1 connected to Z and Z2 to E1
# Prusa Super Pinda probe
# Mellow NF-Sunrise Volcano Hotend/Extruder
# Dual 4020 blowers
# Mellow ATC Semitec 104GT-2 hotend thermistor
# See docs/Config_Reference.md for a description of parameters.
# For more info please check this link: https://www.klipper3d.org
# klipper Config start:
[stepper_x] # Define X stepper
step_pin: PD6 # Step GPIO pin (triggered high).
dir_pin: !PD11 # Direction GPIO pin (high indicates positive direction).
enable_pin: !PC6 # Enable pin (default is enable high; use ! to indicate enable low).
microsteps: 16 # The number of microsteps the stepper motor driver uses.
rotation_distance: 32 # For 16T gear X 2mm pitch GT2 belt.
endstop_pin: ^PC14 # Endstop switch detection pin.
position_endstop: -25 # Location of the endstop (mm)-9.
position_max: 320 # Maximum valid distance (mm) the user may command.
position_min: -25 # Minimum valid distance (mm) the user may command.
homing_speed: 120 # Maximum velocity (in mm/s) of the stepper when homing.
homing_retract_dist: 5 # Distance to backoff (in mm) before homing a second time during homing. Set this to zero to disable the second home.
full_steps_per_rotation: 400 # The number of full steps for one rotation of the stepper motor. 200 for 1.8 motor or 400 for 0.9 motor.
homing_positive_dir: false # If true, homing will cause the stepper to move in a positive direction (away from zero); if false, home towards zero.
[tmc2660 stepper_x] # Define X Driver
cs_pin: PD14 # Step GPIO pin (triggered high)
spi_bus: usart1 # SPI settings
run_current: 1.6 # Please change the motor current to match your motor's specification.(The higher the current, the higher the torque and temperature of the motors I would advice to cool them if printed parts are used)
sense_resistor: 0.051 # The resistance (in ohms) of the motor sense resistor
interpolate: true # If true, enable step interpolation (the driver will internally step at a rate of 256 micro-steps).
[stepper_y] # Define Y stepper (check X description).
step_pin: PD7
dir_pin: !PD12
enable_pin: !PC6
microsteps: 16
rotation_distance: 32
endstop_pin: ^PA2
position_endstop: 317
position_min: -5
position_max: 317
homing_speed: 120
homing_positive_dir: true
homing_retract_dist: 5
full_steps_per_rotation: 400
[tmc2660 stepper_y] # Define Y Driver (check X description).
cs_pin: PC9
spi_bus: usart1
run_current: 1.6 # Please change the motor current to match your motor's specification.(The higher the current, the higher the torque and temperature of the motors I would advice to cool them if printed parts are used)
sense_resistor: 0.051
interpolate: true
[stepper_z] # Define Z steppers (check X description).
step_pin: PD8
dir_pin: PD13
enable_pin: !PC6
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin: probe:z_virtual_endstop
#endstop_pin: ^PD29
#endstop_pin: PD10 # E0 endstop
#endstop_pin: PC16 # E1 endstop
#position_endstop: 0.5
position_min: -5.0
position_max: 320
homing_speed: 10.0
homing_retract_dist: 3.0
homing_retract_speed: 20
second_homing_speed: 2.0
[tmc2660 stepper_z] # Define Z Driver (check X description).
cs_pin: PC10
spi_bus: usart1
run_current: 1.600
sense_resistor: 0.051
interpolate: true
[stepper_z1] # Define Z1 (second) stepper (check X description).
step_pin: PD4
dir_pin: PD9
enable_pin: !PC6
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
[tmc2660 stepper_z1] # Define Z1 (second) driver (check X description).
cs_pin: PC25
spi_bus: usart1
run_current: 1.600
sense_resistor: 0.051
interpolate: true
[extruder] # Define extruder
step_pin: PD5
dir_pin: PA1
enable_pin: !PC6
microsteps: 16
rotation_distance: 4.6095 #4.5477
nozzle_diameter: 0.400
filament_diameter: 1.750
full_steps_per_rotation: 200
heater_pin: !PA20
sensor_type: ATC Semitec 104GT-2 # Type of sensor (Thermistor) NF-sunrise provided Thermistor.
sensor_pin: PC15
smooth_time: 0.6 # A time value (in seconds) over which temperature measurements will be smoothed to reduce the impact of measurement noise.
control = pid # Control algorithm (either pid or watermark)
pid_kp = 26.729
pid_ki = 1.212
pid_kd = 147.344
min_temp: 0
max_temp: 260
min_extrude_temp: 180
max_extrude_only_distance: 200.0
max_extrude_only_velocity: 60
pressure_advance: 0.0405
[firmware_retraction]
retract_speed: 60
unretract_extra_length: 0
retract_length: 0.5
[tmc2660 extruder]
cs_pin: PC17
spi_bus: usart1
run_current: 0.6
sense_resistor: 0.051
interpolate: true
[heater_bed]
heater_pin: !PA19
sensor_type: Generic 3950
sensor_pin: PC13
control: pid
pid_Kp: 71.277
pid_Ki: 1.930
pid_Kd: 657.065
min_temp: 0
max_temp: 130
pwm_cycle_time: 0.02
[controller_fan my_controller_fan] # MB fan
pin: PC23 # FAN0
stepper: stepper_x
kick_start_time: 0.500 # helps get the fan spinning
[heater_fan nozzle_cooling_fan]
pin: PC26 #FAN1
max_power: 1.0
kick_start_time: 0.500
heater: extruder
heater_temp: 40
fan_speed: 1.0
[fan] # Print cooling Fan
pin: PA0 #FAN2
kick_start_time: 0.500 # helps get the fan spinning
[output_pin psupower]
pin: PD15
[gcode_macro M80]
gcode:
SET_PIN PIN=psupower VALUE=1
[gcode_macro M81]
gcode:
SET_PIN PIN=psupower VALUE=0
[mcu] ###### DONT forget to edit the line below with the correct Device ID ######
serial: /dev/serial/by-id/usb-Klipper_sam4e8e_00323053354141543133303137303038-if00
[printer]
kinematics: corexy #type of machine
max_velocity: 1500
max_accel: 9000
max_z_velocity: 20
max_z_accel: 150
max_accel_to_decel: 9000
square_corner_velocity: 5
# uncomment [mcu_rpi], [adxl345], [resonance_tester] and [input_shaper] for input shaper tuning. More info found here https://www.ifixit.com/Guide/Adding+ADXL345+Accelerometer/147745
#[mcu rpi]
#serial: /tmp/klipper_host_mcu
#[adxl345]
#cs_pin: rpi:None
#[resonance_tester]
#accel_chip: adxl345
#probe_points:
# 155,155,20
#[input_shaper]
#shaper_type_x = zv
#shaper_freq_x = 65.8 #73.2
#shaper_type_y = mzv
#shaper_freq_y = 41.2 #46.8
# uncomment your probe type. Don't forget to set your XYZ offset
#[probe] # original Prusa Super PINDA Inductive Probe
#pin: ^PC1
#x_offset: -27.00 # The probe is from the left of the hotend - front look - BLV NF-Sunrise Hotend setup
#y_offset: 29.65 # The probe is behind the hotend - front look - BLV NF-Sunrise Hotend setup
#z_offset = 1.200 # after calibration set your value
#speed: 10 # Probing speed
#samples: 3 # How many times to probe the same point
#sample_retract_dist: 2.0 # How far to retract (in mm) from the probe point
#samples_result: median
#samples_tolerance: .02
#samples_tolerance_retries: 5
#[bltouch] # More info can be found here https://www.klipper3d.org/BLTouch.html
#sensor_pin: ^PC1 # Z_PROBE_IN - Pin connected to the BLTouch sensor pin. Most BLTouch devices require a pullup on the sensor pin (prefix the pin name with "^"). This parameter must be provided.
#control_pin: PC3 # Heater3 - Pin connected to the BLTouch control pin. This parameter must be provided.
#x_offset: # If probe is to the left of the hotend it'll be -, if probe is to the right of the hotend it'll be +
#y_offset: # If probe is in front of the hotend it'll be -, if the probe is behind the hotend it'll be +
#z_offset = # after calibration set your value
#speed: 10 # Probing speed
#samples: 3 # How many times to probe the same point
#sample_retract_dist: 2.0 # How far to retract (in mm) from the probe point
#samples_result: median
#samples_tolerance: .02
#samples_tolerance_retries: 5
[safe_z_home]
home_xy_position: 179.00,115.00 # (155,155) Change coordinates to the center of your print bed
speed: 200 # speed of safe homing
z_hop: 10 # Move up 10mm
z_hop_speed: 5 # Speed of jump while homing jump
[force_move]
enable_force_move: false
[bed_mesh] # mesh of 310x310 minus 5mm each size: 300x300
speed: 300 # The speed (in mm/s) of non-probing moves during the calibration
horizontal_move_z: 3 # The height (in mm) that the head should be commanded to move to just prior to starting a probe operation
mesh_min: 20,30 # Defines the minimum x,y coordinate of the mesh (relative to the probe's location)
mesh_max: 290,280 # Defines the maximum x,y coordinate of the mesh (relative to the probe's location)
probe_count: 4,4 # defining the number of points to probe along each axis
fade_start: 1.0
fade_end: 10.0
split_delta_z: .01 # The amount of Z difference (in mm) along a move that will trigger a split
move_check_distance: 3
mesh_pps: 2,2
algorithm: bicubic
[z_tilt] # Multiple Z stepper tilt adjustment
z_positions: -75.250,155
354.250,155
points: 30.000,125.000
318.000,125.000
speed: 200
horizontal_move_z: 5
retries: 6
retry_tolerance: 0.015
[idle_timeout]
timeout: 1800
#[temperature_sensor Raspberry_cpu] # Pi temperature monitoring
#sensor_type: rpi_temperature
#gcode_id: P
#Fluid addons
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
#fluidd macros
[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
#End fluidd macros
#macros
[delayed_gcode _Startup]
# execute when the delay duration has elapsed.
initial_duration: 1.0 # If set to 0 the delayed_gcode will not execute on startup Default is 0.
gcode:
M117 Welcome!
M117 BLV Cube V1.2 is Ready :)
M80
#SET_FAN_SPEED FAN=Chamber_light SPEED=0.15
[gcode_macro UNLOAD_FILAMENT]
gcode:
SAVE_GCODE_STATE NAME=unload_state
G91 ;relative positioning
M117 Heating...
M109 S{params.TEMP|default(215, true)} ; Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
M117 Unloading filament...
G0 E-5 F3600 ;extract filament to cold end area
G4 P3000 ;wait for three seconds
G0 E5 F3600 ;push back the filament to smash any stringing
G0 E-15 F3600 ;Extract back fast in the cold zone
G0 E-130 F300 ;Continue extraction slowly, allow the filament time to cool solid before it reaches the gears
M117 Filament unloaded!
RESTORE_GCODE_STATE NAME=unload_state
[gcode_macro LOAD_FILAMENT]
gcode:
SAVE_GCODE_STATE NAME=load_state
G91 ;relative positioning
M117 Heating...
M109 S{params.TEMP|default(215, true)} ; Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
M117 Loading filament...
G0 E100 F600 ; Load the filament into the hotend area.
G4 P1000
G0 E40 F100 ; Purge
M400
TURN_OFF_HEATERS
M117 Filament loaded!
RESTORE_GCODE_STATE NAME=load_state
[gcode_macro PRIME_LINE]
gcode:
M109 S210; wait for extruder to heat up
G1 Z5 F3000 ; lift
G1 X5 Y10 F12000 ; move to prime
G1 Z0.3 F3000 ; get ready to prime
G92 E0 ; reset extrusion distance
G1 Y80 E16 F1200 ; prime nozzle
G1 Y100 F15000 ; quick wipe
[gcode_macro z_tilt]
gcode:
Z_TILT_ADJUST
[gcode_macro START_PRINT]
gcode:
SAVE_GCODE_STATE NAME=start_print_state
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
G28 ;home
M117 Heating...
M190 S{params.BED_TEMP|default(printer.heater_bed.target, true) }; wait for bed to heat up
M109 S150 ; Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp. Also allows the bed heat to spread a little.
Z_TILT_ADJUST ;Adjust bed tilt
G28 Z ;Home again as Z will have changed after tilt adjustment and bed heating.
BED_MESH_CALIBRATE ; Calibrate bed mesh
G0 X10 Y310 Z10 F6000 ; Park in the back and wait for extruder
M109 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) }; wait for extruder to heat up
M117 Printing...
RESTORE_GCODE_STATE NAME=start_print_state
# The end_print macro is also called from CANCEL_PRINT.
[gcode_macro END_PRINT]
gcode:
SAVE_GCODE_STATE NAME=end_print_state
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off
G91 ;relative positioning
G1 Z10 E-2 F3600 ;retract the filament a bit before lifting the nozzle.
G1 E-2 F3600 ;retract filament even more
G90 ;absolute positioning
G0 X10 Y310 ; Park in the back
M84 ;steppers off
M107 ; part cooling fan off
M117 Done.
RESTORE_GCODE_STATE NAME=end_print_state
# Power On Button wired to E1_STOP
[gcode_button power_on]
pin: !PC16 #E1_STOP
press_gcode: M80