forked from K1-Klipper/cartographer-klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cartographer_macro.cfg
84 lines (66 loc) · 5.9 KB
/
cartographer_macro.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
# the macro's here are used to instead of the default cartographer console commands.
# this is due to the camera using too much usb bus bandwidth. when calibrating with the camera enabled on the stock board theres a very high chance of the mcu crashing or timing out.
# credits to ShimaYT, Destinal, BootyEngineer and Zarboz <3
[gcode_shell_command cam-stop] # define camera stop script refferenced below
command: killall mjpg_streamer && killall cam_app && killall cx_ai_middleware # kills all creality camera related services
timeout:4 # waits 4 seconds to ensure the command worked before timing it out
verbose: false # shows results of command in klipper console - set to false once working
[gcode_shell_command cam-start] # define camera start script refferenced below, edit at your own risk as it can cause mcu crash while printing
command: /opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d /dev/video4 -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p 8080"
timeout: 4 # waits 4 seconds to ensure the command worked before timing it out
verbose: false # shows results of command in klipper console - set to false once working
[gcode_macro CARTO_ESTIMATE_BACKLASH]
description: calibrate cartographer backlash without crashing
gcode:
g28 # home axis required
RUN_SHELL_COMMAND CMD=cam-stop # stop camera services
{% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %}
{% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %}
G1 X{POSITION_X} Y{POSITION_Y} F6000 # moves print head to center of bed
CARTOGRAPHER_ESTIMATE_BACKLASH # do z backlash command
RUN_SHELL_COMMAND CMD=cam-start # restart camera services
[gcode_macro CARTO_PROBE_ACCURACY]
description: test zprobe accuracy without crashing.
gcode:
g28 # home axis required
RUN_SHELL_COMMAND CMD=cam-stop # stop camera services
{% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %}
{% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %}
G1 X{POSITION_X} Y{POSITION_Y} F6000 # moves print head to center of bed
PROBE_ACCURACY # test probe accuracy
RUN_SHELL_COMMAND CMD=cam-start # restart camera services
[gcode_macro CARTO_CALIBRATE]
description: calibrate initial Z offset without crashing mcu.
gcode:
G28 X Y # home the X Y
RUN_SHELL_COMMAND CMD=cam-stop # stop camera services
G90 # sets position to absolute
{% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %}
{% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %}
G1 X{POSITION_X} Y{POSITION_Y} F6000 # moves print head to center of bed
CARTOGRAPHER_CALIBRATE # calibrate Initial Z command.
[gcode_macro cam_restart] # booty was right dont use dashes -_-
description: restarts camera and changes resolution to what is defined in printer.cfg
gcode:
RUN_SHELL_COMMAND CMD=cam-stop # stops the camera
RUN_SHELL_COMMAND CMD=cam-start # starts the camera
[gcode_macro cam_stop]
description: stops the camera from running
gcode:
RUN_SHELL_COMMAND CMD=cam-stop # stops the camera
[gcode_macro cam_start]
description: starts camera and changes resolution to what is defined in printer.cfg
gcode:
RUN_SHELL_COMMAND CMD=cam-start # starts the camera back up
[gcode_macro carto_bed_mesh]
description: stops the camera to mesh the bed then restarts
gcode:
RUN_SHELL_COMMAND CMD=cam-stop # stop camera services to prevent mcu overload
G4 P1000 # wait required to allow the camera services to close
BED_MESH_CLEAR # clear current mesh
G4 P500 # wait required to prevent MCU overload / inconsistant meshing
SET_VELOCITY_LIMIT ACCEL=15000 ACCEL_TO_DECEL=10000 # drop accels to prevent hyper agressive meshing
BED_MESH_CALIBRATE # start bedmesh calibrate
G4 P500 # wait required to prevent MCU overload / inconsistant mesh calculation
SET_VELOCITY_LIMIT ACCEL=20000 ACCEL_TO_DECEL=10000 # raise accels back to stock machine standard speeds.
RUN_SHELL_COMMAND CMD=cam-start # re-start creality camera service