v2.4: restructure all the things
This commit is contained in:
		
							parent
							
								
									b67abe3a17
								
							
						
					
					
						commit
						a8f3ab247a
					
				
					 13 changed files with 822 additions and 737 deletions
				
			
		|  | @ -3,12 +3,12 @@ moonraker_host: 127.0.0.1 | |||
| moonraker_port: 7125 | ||||
| 
 | ||||
| [preheat PLA] | ||||
| bed = 40 | ||||
| extruder = 195 | ||||
| bed = 50 | ||||
| extruder = 200 | ||||
| 
 | ||||
| [preheat ABS] | ||||
| bed = 90 | ||||
| extruder = 220 | ||||
| bed = 100 | ||||
| extruder = 250 | ||||
| 
 | ||||
| [menu __main] | ||||
| name: {{ gettext('Main Menu') }} | ||||
|  |  | |||
							
								
								
									
										10
									
								
								macros/_init.cfg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								macros/_init.cfg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| ##################################################################### | ||||
| #  include all the macros | ||||
| #  large parts taken from alexz and others | ||||
| ##################################################################### | ||||
| [include debug.cfg] | ||||
| [include helpers.cfg] | ||||
| [include override.cfg] | ||||
| [include print.cfg] | ||||
| [include probe.cfg] | ||||
| [include z_calibration.cfg] | ||||
							
								
								
									
										85
									
								
								macros/debug.cfg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								macros/debug.cfg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,85 @@ | |||
| ##################################################################### | ||||
| #  Macros to debug the printer variable | ||||
| #  - DUMP_PARAMETERS | ||||
| #  - DUMP_CONFIG | ||||
| #  - DUMP_WARNINGS | ||||
| #  - DUMP_SETTINGS | ||||
| ##################################################################### | ||||
| 
 | ||||
| 
 | ||||
| ## Use: | ||||
| ##   - DUMP_PARAMETERS | ||||
| ##   - DUMP_PARAMETERS S='gcode_macro _USER_VARIABLE' | ||||
| [gcode_macro DUMP_PARAMETERS] | ||||
| description: Debug: Print all entries of the printer object | ||||
| gcode: | ||||
|   {% set parameters = [] %} | ||||
|   {% for name1 in printer|sort %} | ||||
|     {% if 'S' in params %} | ||||
|       {% if name1 is in [params.S] %} | ||||
|         {% for name2 in printer[name1]|sort %} | ||||
|           {% set parameters = parameters.append("printer['%s'].%s = %s" % (name1, name2, printer[name1][name2])) %} | ||||
|         {% endfor %} | ||||
|       {% endif %} | ||||
|     {% else %} | ||||
|       {% if name1 is not in ['configfile'] %} | ||||
|         {% for name2 in printer[name1]|sort %} | ||||
|           {% set parameters = parameters.append("printer['%s'].%s = %s" % (name1, name2, printer[name1][name2])) %} | ||||
|         {% endfor %} | ||||
|       {% endif %} | ||||
|     {% endif %} | ||||
|   {% endfor %} | ||||
|   {action_respond_info(parameters|join("\n"))} | ||||
| 
 | ||||
| ## Use: | ||||
| ##   - DUMP_CONFIG S='printer' | ||||
| [gcode_macro DUMP_CONFIG] | ||||
| description: Debug: Print the selected entry of the printer config object | ||||
| gcode: | ||||
|   {% if 'S' in params %} | ||||
|     {% set parameters = [] %} | ||||
|     {% for name1 in printer.configfile.config %} | ||||
|       {% if name1 is in [params.S] %} | ||||
|         {% for name2 in printer.configfile.config[name1]|sort %} | ||||
|           {% set parameters = parameters.append("printer.configfile.config['%s'].%s = %s" % (name1, name2, printer.configfile.config[name1][name2])) %} | ||||
|         {% endfor %} | ||||
|       {% endif %} | ||||
|     {% endfor %} | ||||
|     {action_respond_info(parameters|join("\n"))} | ||||
|   {% else %} | ||||
|     {action_respond_info("WARNING: parameter S needed call e.g. DUMP_CONFIG S='printer'")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| ## Use: | ||||
| ##   - DUMP_WARNINGS | ||||
| [gcode_macro DUMP_WARNINGS] | ||||
| description: Debug: Print all warning messages from klipper | ||||
| gcode: | ||||
|   {% set parameters = ["printer.configfile.warnings:"] %} | ||||
|   {% for name1 in printer.configfile.warnings %} | ||||
|       {% set parameters = parameters.append("%s -> %s -> %s\n%s" % (name1.type, name1.section, name1.option, name1.message)) %} | ||||
|   {% endfor %} | ||||
|   {action_respond_info(parameters|join("\n"))} | ||||
| 
 | ||||
| ## Use: | ||||
| ##   - DUMP_SETTINGS S='printer' | ||||
| [gcode_macro DUMP_SETTINGS] | ||||
| description: Debug: Print the selected entry of the printer settings object | ||||
| gcode: | ||||
|   {% if 'S' in params %} | ||||
|     {% set parameters = [] %} | ||||
|     {% for name1 in printer.configfile.settings %} | ||||
|       {% if name1 is in [params.S] %} | ||||
|         {% for name2 in printer.configfile.settings[name1]|sort %} | ||||
|           {% set parameters = parameters.append("printer.configfile.settings['%s'].%s = %s" % (name1, name2, printer.configfile.settings[name1][name2])) %} | ||||
|         {% endfor %} | ||||
|       {% endif %} | ||||
|     {% endfor %} | ||||
|     {action_respond_info(parameters|join("\n"))} | ||||
|   {% else %} | ||||
|     {action_respond_info("WARNING: parameter S needed call e.g. DUMP_SETTINGS S='printer'")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| ##################################################################### | ||||
| #  Macros needed for several debug activities | ||||
| ##################################################################### | ||||
							
								
								
									
										55
									
								
								macros/helpers.cfg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								macros/helpers.cfg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,55 @@ | |||
| #################################################################### | ||||
| # Helper macros | ||||
| # - MOVE_SPEED | ||||
| # - ZES | ||||
| #################################################################### | ||||
| 
 | ||||
| [gcode_macro MOVE_SPEED] | ||||
| description: move along certain patterns with selected speed | ||||
| gcode: | ||||
|   {% set F=params.F|default(3000)|int %} | ||||
|   {% if printer.idle_timeout.state != "Printing" %} | ||||
|     {% if "xyz" in printer.toolhead.homed_axes %} | ||||
|       {action_respond_info("moving with F%d" % F)} | ||||
|       ; square clockwise | ||||
|       M117 > square clockwise | ||||
|       G0 X275 Y275 F{F} | ||||
|       G0 Y25 | ||||
|       G0 X25 | ||||
|       G0 Y275 | ||||
|       G0 X275 | ||||
|       ; square counter-clockwise | ||||
|       M117 > square counter-clockwise | ||||
|       G0 X25 | ||||
|       G0 Y25 | ||||
|       G0 X275 | ||||
|       G0 Y275 | ||||
|       ; diagonal motor a | ||||
|       M117 > diagonal motor a | ||||
|       G0 X25 Y25 | ||||
|       G0 X275 Y275 | ||||
|       G0 X25 | ||||
|       ; diagonal motor b | ||||
|       M117 > diagonal motor b | ||||
|       G0 X275 Y25 | ||||
|       G0 X25 Y275 | ||||
|       G0 X275 Y275 | ||||
|     {% else %} | ||||
|       {action_respond_info("Printer not homed")} | ||||
|     {% endif %} | ||||
|   {% else %} | ||||
|     {action_respond_info("Already printing")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro ZES] | ||||
| description: Z_ENDSTOP_CALIBRATE + extras | ||||
| gcode: | ||||
|   {% if printer.idle_timeout.state != "Printing" %} | ||||
|     G28 | ||||
|     G0 X150 Y150 Z10 F10000 | ||||
|     Z_ENDSTOP_CALIBRATE | ||||
|     TESTZ Z=-9 | ||||
|   {% else %} | ||||
|     {action_respond_info("Already printing")} | ||||
|   {% endif %} | ||||
							
								
								
									
										147
									
								
								macros/override.cfg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										147
									
								
								macros/override.cfg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,147 @@ | |||
| ##################################################################### | ||||
| #	Customized standard macros | ||||
| ##################################################################### | ||||
| # | ||||
| #        !!! Caution !!! | ||||
| # | ||||
| # PROBE_CALIBRATE can not dock the Magprobe automatically, as it | ||||
| # start's a scripting process we need to stop at the execution | ||||
| # of the base macro. Use | ||||
| #  - PROBE_ABORT | ||||
| #  - PROBE_ACCEPT | ||||
| # instead of the original ABORT and ACCEPT to also dock the probe | ||||
| # | ||||
| # - BED_MESH_CALIBRATE | ||||
| # - G0 | ||||
| # - G1 | ||||
| # - QUAD_GANTRY_LEVEL | ||||
| ##################################################################### | ||||
| 
 | ||||
| 
 | ||||
| ## BED_MESH_CALIBRATE | ||||
| [gcode_macro BED_MESH_CALIBRATE] | ||||
| description: Perform QGL and bed mesh leveling | ||||
| rename_existing: _BED_MESH_CALIBRATE_BASE | ||||
| gcode: | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   _CG28 | ||||
|   BED_MESH_CLEAR | ||||
|   ## check if QGL was already executed | ||||
|   {% if printer.quad_gantry_level.applied|lower == 'false' %} | ||||
|     QUAD_GANTRY_LEVEL PARK=false | ||||
|   {% endif %} | ||||
|   ATTACH_PROBE | ||||
|   _BED_MESH_CALIBRATE_BASE {get_params|join(" ")} | ||||
|   DETACH_PROBE | ||||
| 
 | ||||
| ## GO | ||||
| # If your probe needs a Z move for attach/detach use either | ||||
| #   G0 .... FORCE | ||||
| [gcode_macro G0] | ||||
| description: Move gcode that prevents moves lower than the limit when probe attached | ||||
| rename_existing: G0.1 | ||||
| gcode: | ||||
|   ##### set manual override ##### | ||||
|   {% if 'FORCE' in params|upper %} | ||||
|     {% set force = 1 %} | ||||
|   {% else %} | ||||
|     {% set force = 0 %} | ||||
|   {% endif %} | ||||
|   ##### get params ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter | ||||
|       {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|     {% endif %} | ||||
|   {% endfor %} | ||||
|   ##### add caller ##### | ||||
|   {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop | ||||
|   ##### add force ##### | ||||
|   {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop | ||||
|   ##### end of definition ##### | ||||
|   {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} | ||||
|     _MAG_PROBE ACTION=GET_STATUS RESPOND=0 | ||||
|   {% endif %} | ||||
|   _Z_MOVE_CHECK {get_params|join(" ")} | ||||
| 
 | ||||
| ## TODO | ||||
| ## G1 | ||||
| # If your probe needs a Z move for attach/detach use either | ||||
| #   G1 .... FORCE | ||||
| # [gcode_macro G1] | ||||
| # description: Move gcode that prevents moves lower than the limit when probe attached | ||||
| # rename_existing: G1.1 | ||||
| # gcode: | ||||
| #   ##### set manual override ##### | ||||
| #   {% if 'FORCE' in params|upper %} | ||||
| #     {% set force = 1 %} | ||||
| #   {% else %} | ||||
| #     {% set force = 0 %} | ||||
| #   {% endif %} | ||||
| #   ##### get params ##### | ||||
| #   {% set get_params = [] %} | ||||
| #   {% for key in params %} | ||||
| #     {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter | ||||
| #       {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
| #     {% endif %} | ||||
| #   {% endfor %} | ||||
| #   ##### add caller ##### | ||||
| #   {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop | ||||
| #   ##### add force ##### | ||||
| #   {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop | ||||
| #   ##### end of definition ##### | ||||
| #   {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} | ||||
| #     _MAG_PROBE ACTION=GET_STATUS RESPOND=0 | ||||
| #   {% endif %} | ||||
| #   _Z_MOVE_CHECK {get_params|join(" ")} | ||||
| 
 | ||||
| 
 | ||||
| ## QUAD_GANTRY_LEVEL | ||||
| [gcode_macro QUAD_GANTRY_LEVEL] | ||||
| description: Level a flying gantry to a stationary bed | ||||
| rename_existing: _QUAD_GANTRY_LEVEL | ||||
| gcode: | ||||
|   #####  get user defines  ##### | ||||
|   {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   #####  set default  ##### | ||||
|   {% set park = params.PARK|default('true') %} | ||||
|   #####  end of definitions  ##### | ||||
|   # home all axes if not already | ||||
|   {% if "xyz" not in printer.toolhead.homed_axes %} | ||||
|     _CG28 | ||||
|   {% endif %} | ||||
|   SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL | ||||
|   _SET_ACC VAL=HOME | ||||
|   _SET_CURRENT VAL=HOME | ||||
|   _CG28 RESET_SETTINGS=false | ||||
|   {% if act_z < z_hop %} | ||||
|     G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case | ||||
|   {% endif %} | ||||
|   ATTACH_PROBE | ||||
|   _QUAD_GANTRY_LEVEL | ||||
|   {% if params.CALIBRATE|default('false') == 'true' %} | ||||
|     CALIBRATE_Z RESET_SETTINGS=false | ||||
|   {% else %} | ||||
|     DETACH_PROBE | ||||
|   {% endif %} | ||||
|   #G28 Z | ||||
|   {% if params.RESET_SETTINGS|default('true') == 'true' %} | ||||
|     _SET_CURRENT | ||||
|     _SET_ACC | ||||
|   {% endif %} | ||||
|   {% if park|lower == 'true' %} | ||||
|     G90 | ||||
|     G0 Z{park_pos[2]} F1800           ; move nozzle to z high first | ||||
|     G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle | ||||
|   {% endif %} | ||||
|   RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL | ||||
| 
 | ||||
| 
 | ||||
|  | @ -1,60 +1,59 @@ | |||
| ## HELPERS | ||||
| [gcode_macro ZES] | ||||
| description: Z_ENDSTOP_CALIBRATE + extras | ||||
| gcode: | ||||
|   G28 | ||||
|   G0 X150 Y150 Z10 F10000 | ||||
|   Z_ENDSTOP_CALIBRATE | ||||
|   TESTZ Z=-9 | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro CENTER] | ||||
| gcode: | ||||
|   {% set X=params.X|default(150) %} | ||||
|   {% set Y=params.Y|default(150) %} | ||||
|   {% set Z=params.Z|default(25) %} | ||||
|   {% if "xyz" in printer.toolhead.homed_axes %} | ||||
|     G0 X{X} Y{Y} Z{Z} F10000 | ||||
|   {% else %} | ||||
|     {action_respond_info("Printer not homed")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro PURGE_NOZZLE] | ||||
| gcode: | ||||
|   {% set x0=params.x0|default(75) %} | ||||
|   {% set x1=params.x1|default(225) %} | ||||
|   {% set y0=params.y0|default(15) %} | ||||
|   {% set y1=params.y1|default(15.8) %} | ||||
|   M117 > purge nozzle | ||||
|   G0 Z10 F300                 # move Z to travel height | ||||
|   G0 X{x0} Y{y0} F5000        # move to x0/y0 | ||||
|   G0 Z0.2 F1500               # lower Z | ||||
|   G0 X{x1} E30                # draw line | ||||
|   G0 Y{y1}                    # move to y1 | ||||
|   G0 X{x0} E15                # draw fine line | ||||
| #################################################################### | ||||
| # Macros used for printing | ||||
| # - BRUSHIE | ||||
| # - CANCEL_PRINT | ||||
| # - M600 | ||||
| # - PARK | ||||
| # - PAUSE | ||||
| # - PRINT_START | ||||
| # - PRINT_END | ||||
| # - PURGE_NOZZLE | ||||
| # - RESUME | ||||
| #################################################################### | ||||
| 
 | ||||
| 
 | ||||
| # BRUSHIE | ||||
| [gcode_macro BRUSHIE] | ||||
| gcode: | ||||
|   {% set x0=50 %} | ||||
|   {% set x0=40 %} | ||||
|   {% set x1=110 %} | ||||
|   {% set y0=305 %} | ||||
|   {% set z0=2 %} | ||||
|   {% set z0=1 %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} | ||||
|   {% if "xyz" in printer.toolhead.homed_axes %} | ||||
|     M117 > brushie brushie brushie | ||||
|     G0 Z20 F1000                # move Z to travel height | ||||
|     G0 Z{z_hop} F1000           # move Z to travel height | ||||
|     G0 X{x0} Y{y0} F5000        # move to x0/y0 | ||||
|     G0 Z{z0}                    # lower | ||||
|     G0 X{x1}                    # back | ||||
|     G0 X{x0}                    # forth | ||||
|     G0 X{x1}                    # back | ||||
|     G0 Z20 F300                 # move Z to travel height | ||||
|     G0 Z{z_hop} F300            # move Z to travel height | ||||
|   {% else %} | ||||
|     {action_respond_info("Printer not homed")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| # CANCEL_PRINT | ||||
| [gcode_macro CANCEL_PRINT] | ||||
| description: Cancel the actual running print | ||||
| rename_existing: _CANCEL_PRINT_BASE | ||||
| gcode: | ||||
|   TURN_OFF_HEATERS | ||||
|   PARK | ||||
|   _CANCEL_PRINT_BASE | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro M600] | ||||
| description: Change filament | ||||
| gcode: | ||||
|   SAVE_GCODE_STATE NAME=M600_state | ||||
|   PAUSE Y=15 | ||||
|   M117 > change filament | ||||
|   RESTORE_GCODE_STATE NAME=M600_state | ||||
| 
 | ||||
| 
 | ||||
| # PARK | ||||
| [gcode_macro PARK] | ||||
| gcode: | ||||
|   {% set Y=params.Y|default(295) %} | ||||
|  | @ -83,26 +82,41 @@ gcode: | |||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro M600] | ||||
| description: Change filament | ||||
| # PAUSE | ||||
| [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: | ||||
|   SAVE_GCODE_STATE NAME=M600_state | ||||
|   PAUSE Y=15 | ||||
|   M117 > change filament | ||||
|   RESTORE_GCODE_STATE NAME=M600_state | ||||
|   {% set Y=params.Y|default(295) %} | ||||
|   # read E from pause macro | ||||
|   {% set E = printer["gcode_macro PAUSE"].extrude|float %} | ||||
|   # end of definitions | ||||
|   M117 > pause | ||||
|   _PAUSE_BASE | ||||
|   {% if printer.extruder.can_extrude|lower == 'true' %} | ||||
|     G91 | ||||
|     G1 E-{E} F2100 | ||||
|     G90 | ||||
|   {% else %} | ||||
|     {action_respond_info("Extruder not hot enough")} | ||||
|   {% endif %} | ||||
|   PARK Y={Y} | ||||
| 
 | ||||
| 
 | ||||
| ## PRINT_ | ||||
| # - PRINT_START | ||||
| [gcode_macro PRINT_START] | ||||
| gcode: | ||||
|   {% set BED=params.BED|default(100)|int %} | ||||
|   {% set EXTRUDER=params.EXTRUDER|default(250)|int %} | ||||
|   {% set CHAMBER=params.CHAMBER|default(0)|int %} | ||||
|   {% set BMC=params.BMC|default(0)|int %} | ||||
|   {% set QGL=params.QGL|default(0)|int %} | ||||
|   {% set PURGE=params.PURGE|default(1)|int %} | ||||
|   {% set SOAK=params.SOAK|default(0)|int * 1000 * 60 %} | ||||
|   {% set Z_ADJUST=params.Z_ADJUST|default(0.0)|float %} | ||||
|   # TODO | ||||
|   # TODO: ERCF | ||||
|   {% set ERCF=params.ERCF|default(0) %} | ||||
|   {action_respond_info("starting print BED=%d, EXTRUDER=%d, BMC=%d, PURGE=%d, SOAK=%d, Z_AJUST=%f" % (BED, EXTRUDER, BMC, PURGE, SOAK, Z_ADJUST))} | ||||
|   M117 > configuring | ||||
|  | @ -124,10 +138,12 @@ gcode: | |||
|   {% endif %} | ||||
|   M117 > home | ||||
|   G28 | ||||
|   M117 > qgl | ||||
|   QUAD_GANTRY_LEVEL | ||||
|   M117 > brushie | ||||
|   BRUSHIE | ||||
|   {% if QGL %} | ||||
|     M117 > qgl | ||||
|     QUAD_GANTRY_LEVEL PARK=false | ||||
|     BRUSHIE | ||||
|   {% endif %} | ||||
|   M117 > calibrate z | ||||
|   CALIBRATE_Z | ||||
|   {% if BMC %} | ||||
|  | @ -159,6 +175,7 @@ gcode: | |||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| # - PRINT_END | ||||
| [gcode_macro PRINT_END] | ||||
| gcode: | ||||
|   M117 > finished | ||||
|  | @ -170,40 +187,28 @@ gcode: | |||
|   M107                          ; turn off fan | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro PRINT_LAYER_CHANGE] | ||||
| # - PURGE_NOZZLE | ||||
| [gcode_macro PURGE_NOZZLE] | ||||
| gcode: | ||||
|   {% set layer=params.LAYER|default(0)|int %} | ||||
|   {% set layer_z=params.LAYER_Z|default(0) %} | ||||
|   {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} | ||||
|   M117 > layer {layer+1}/{total_layer_count} {layer_z}mm | ||||
| 
 | ||||
| 
 | ||||
| ## OVERRIDES | ||||
| [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: | ||||
|   {% set Y=params.Y|default(295) %} | ||||
|   # read E from pause macro | ||||
|   {% set E = printer["gcode_macro PAUSE"].extrude|float %} | ||||
|   # end of definitions | ||||
|   M117 > pause | ||||
|   PAUSE_BASE | ||||
|   {% if printer.extruder.can_extrude|lower == 'true' %} | ||||
|     G91 | ||||
|     G1 E-{E} F2100 | ||||
|     G90 | ||||
|   {% else %} | ||||
|     {action_respond_info("Extruder not hot enough")} | ||||
|   {% endif %} | ||||
|   PARK Y={Y} | ||||
|   {% set x0=params.x0|default(100) %} | ||||
|   {% set x1=params.x1|default(200) %} | ||||
|   {% set y0=params.y0|default(0) %} | ||||
|   {% set y1=params.y1|default(0.8) %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|int %} | ||||
|   M117 > purge nozzle | ||||
|   G0 Z{z_hop} F300            # move Z to travel height | ||||
|   G0 X{x0} Y{y0} F5000        # move to x0/y0 | ||||
|   G0 Z0.2 F1500               # lower Z | ||||
|   G0 X{x1} E20                # draw line | ||||
|   G0 Y{y1}                    # move to y1 | ||||
|   G0 X{x0} E10                # draw fine line | ||||
|   G0 Z{z_hop} F300            # move Z to travel height | ||||
| 
 | ||||
| 
 | ||||
| # - RESUME | ||||
| [gcode_macro RESUME] | ||||
| description: Resume the actual running print | ||||
| rename_existing: RESUME_BASE | ||||
| rename_existing: _RESUME_BASE | ||||
| gcode: | ||||
|   # read E from pause macro | ||||
|   {% set E = printer["gcode_macro PAUSE"].extrude|float %} | ||||
|  | @ -221,38 +226,12 @@ gcode: | |||
|   {% else %} | ||||
|     {action_respond_info("Extruder not hot enough")} | ||||
|   {% endif %} | ||||
|   RESUME_BASE {get_params} | ||||
|   _RESUME_BASE {get_params} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro CANCEL_PRINT] | ||||
| description: Cancel the actual running print | ||||
| rename_existing: CANCEL_PRINT_BASE | ||||
| [gcode_macro PRINT_LAYER_CHANGE] | ||||
| gcode: | ||||
|   TURN_OFF_HEATERS | ||||
|   PARK | ||||
|   CANCEL_PRINT_BASE | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro PROBE] | ||||
| description: Override PROBE and make sure we're over the bed | ||||
| rename_existing: PROBE_BASE | ||||
| gcode: | ||||
|   {% set P = printer["gcode_macro _Probe_Variables"].probe_attached %} | ||||
|   {% if printer.toolhead.position.y|float > 270 %} | ||||
|     G0 Y270 | ||||
|   {% endif %} | ||||
|   {% if P %} | ||||
|     PROBE_BASE | ||||
|   {% else %} | ||||
|       {action_respond_info("Probe not attached")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro PROBE_CALIBRATE] | ||||
| description: Override PROBE_CALIBRATE and make sure we're over the bed | ||||
| rename_existing: PROBE_CALIBRATE_BASE | ||||
| gcode: | ||||
|   {%- if printer.toolhead.position.y|float > 270 -%} | ||||
|     G0 Y270 | ||||
|   {%- endif -%} | ||||
|   PROBE_CALIBRATE_BASE | ||||
|   {% set layer=params.LAYER|default(0)|int %} | ||||
|   {% set layer_z=params.LAYER_Z|default(0) %} | ||||
|   {% set total_layer_count=params.TOTAL_LAYER_COUNT|default(0) %} | ||||
|   M117 > layer {layer+1}/{total_layer_count} {layer_z}mm | ||||
|  | @ -1,91 +1,211 @@ | |||
| ##################################################################### | ||||
| #    Mag Probe | ||||
| # Macros for mag probe | ||||
| # - ATTACH_PROBE | ||||
| # - DETACH_PROBE | ||||
| # - GET_PROBE_STATUS | ||||
| # - QUERY_PROBE | ||||
| # - PROBE | ||||
| # - PROBE_ABORT | ||||
| # - PROBE_ACCURACY | ||||
| # - PROBE_ACCEPT | ||||
| # - PROBE_CALIBRATE | ||||
| # - SET_PROBE_STATUS | ||||
| # - _ATTACH_PROBE | ||||
| # - _DOCK_PROBE | ||||
| # - _MAG_PROBE | ||||
| # - _PROBE_ACTION | ||||
| # - _Z_MOVE_CHECK | ||||
| ##################################################################### | ||||
| # defined in printer.cfg | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Gantry Adjustment Routines | ||||
| ##################################################################### | ||||
| [quad_gantry_level] | ||||
| ##	Gantry Corners for 300mm Build | ||||
| gantry_corners: | ||||
| 	-60,-10 | ||||
| 	360,370 | ||||
| #	Probe points for 300m Build | ||||
| points: | ||||
| 	50,25 | ||||
| 	50,225 | ||||
| 	250,225 | ||||
| 	250,25 | ||||
| speed: 300 | ||||
| horizontal_move_z: 10 | ||||
| retries: 5 | ||||
| retry_tolerance: 0.007 | ||||
| max_adjust: 10 | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Macros | ||||
| ##################################################################### | ||||
| [gcode_macro QUAD_GANTRY_LEVEL] | ||||
| description: Level a flying gantry to a stationary bed | ||||
| rename_existing: QUAD_GANTRY_LEVEL_BASE | ||||
| gcode: | ||||
|   #####  get user defines  ##### | ||||
|   {% set park_pos = printer['gcode_macro _USER_VARIABLE'].park_bed %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop|float %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   #####  set default  ##### | ||||
|   {% set park = params.PARK|default('true') %} | ||||
|   #####  end of definitions  ##### | ||||
|   # home all axes if not already | ||||
|   {% if "xyz" not in printer.toolhead.homed_axes %} | ||||
|     _CG28 | ||||
|   {% endif %} | ||||
|   SAVE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL | ||||
|   _SET_ACC VAL=HOME | ||||
|   _SET_CURRENT VAL=HOME | ||||
|   _CG28 RESET_SETTINGS=false | ||||
|   {% if act_z < z_hop %} | ||||
|     G1 Z{z_hop} F900 ; move head up to insure Probe is not triggered in error case | ||||
|   {% endif %} | ||||
|   ATTACH_PROBE  | ||||
|   QUAD_GANTRY_LEVEL_BASE | ||||
|   {% if params.CALIBRATE|default('false') == 'true' %} | ||||
|     CALIBRATE_Z RESET_SETTINGS=false | ||||
|   {% else %} | ||||
|     DETACH_PROBE | ||||
|   {% endif %} | ||||
|   #G28 Z | ||||
|   {% if params.RESET_SETTINGS|default('true') == 'true' %} | ||||
|     _SET_CURRENT | ||||
|     _SET_ACC | ||||
|   {% endif %} | ||||
|   {% if park|lower == 'true' %} | ||||
|     G90 | ||||
|     G0 Z{park_pos[2]} F1800           ; move nozzle to z high first | ||||
|     G0 X{park_pos[0]} Y{park_pos[1]} F18000 ; home to get toolhead in the middle | ||||
|   {% endif %} | ||||
|   RESTORE_GCODE_STATE NAME=STATE_QUAD_GANTRY_LEVEL | ||||
| 
 | ||||
| ## ATTACH_PROBE | ||||
| [gcode_macro ATTACH_PROBE] | ||||
| description: Attaching the MagProbe if not already attached | ||||
| gcode: | ||||
|   _MAG_PROBE ACTION=ATTACH | ||||
|   _MAG_PROBE ACTION=CHECK_ATTACH | ||||
| 
 | ||||
| 
 | ||||
| ## DETACH_PROBE | ||||
| [gcode_macro DETACH_PROBE] | ||||
| description: Dock the MagProbe if not already docked | ||||
| gcode: | ||||
|   _MAG_PROBE ACTION=DOCK | ||||
|   _MAG_PROBE ACTION=CHECK_DOCK | ||||
| 
 | ||||
| 
 | ||||
| ## GET_PROBE_STATUS | ||||
| [gcode_macro GET_PROBE_STATUS] | ||||
| description: Prints the current MagProbe state, valid probe states are UNKNOWN, ATTACHED and DOCKED | ||||
| gcode: | ||||
|   _MAG_PROBE ACTION=GET_STATUS RESPOND=1 | ||||
| 
 | ||||
| 
 | ||||
| ## QUERY_PROBE | ||||
| [gcode_macro QUERY_PROBE] | ||||
| description: Return the status of the z-probe and store ID | ||||
| rename_existing: _QUERY_PROBE_BASE | ||||
| variable_id: 0 | ||||
| gcode: | ||||
|   {% set id = params.ID|default(0) %} ; call id 0 means invalid | ||||
|   _QUERY_PROBE_BASE | ||||
|   SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} | ||||
| 
 | ||||
| 
 | ||||
| ## PROBE | ||||
| [gcode_macro PROBE] | ||||
| description: Probe Z-height at current XY position and dock/undock MagProbe | ||||
| rename_existing: _PROBE_BASE | ||||
| gcode: | ||||
|   #####  get new parameter. ##### | ||||
|   {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   {% if printer.toolhead.position.y|float > 270 %} | ||||
|     G0 Y270 | ||||
|   {% endif %} | ||||
|   _PROBE_BASE {get_params|join(" ")} | ||||
|   G1 Z{z_min} F900 ; move head up to remove trigger | ||||
|   {% if dock == 1 %} | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   {% endif %} | ||||
|   {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| ## PROBE_ABORT | ||||
| [gcode_macro PROBE_ABORT] | ||||
| description: Abort manual Z probing tool for Probe and dock MagProbe | ||||
| variable_caller: 'unknown' | ||||
| variable_absolute_coordinates: False | ||||
| gcode: | ||||
|   ##### get user defines  ##### | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### end of definitions ##### | ||||
|   {% if caller|lower|string == 'calib' %} | ||||
|     ABORT | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|     {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|       SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' | ||||
|   {% else %} | ||||
|     {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| ## PROBE_ACCURACY | ||||
| [gcode_macro PROBE_ACCURACY] | ||||
| description: Probe Z-height accuracy at current XY position and dock/undock MagProbe | ||||
| rename_existing: _PROBE_ACCURACY_BASE | ||||
| gcode: | ||||
|   #####  get new parameter. ##### | ||||
|   {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} | ||||
|   _PROBE_ACCURACY_BASE {get_params|join(" ")} | ||||
|   {% if dock == 1 %} | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} | ||||
|   {% endif %} | ||||
|   {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| ## PROBE_ACCEPT | ||||
| [gcode_macro PROBE_ACCEPT] | ||||
| description: Accept the current Z position for Probe and dock MagProbe | ||||
| gcode: | ||||
|   #####  get variables from ABORT  ##### | ||||
|   {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} | ||||
|   {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} | ||||
|   ##### get user defines  ##### | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### end of definitions ##### | ||||
|   {% if caller|lower|string == 'calib' %} | ||||
|     ACCEPT | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|     {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|       SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' | ||||
|   {% else %} | ||||
|     {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| ## PROBE_CALIBRATE | ||||
| [gcode_macro PROBE_CALIBRATE] | ||||
| description: Calibrate the probes z_offset and undock MagProbe | ||||
| rename_existing: _PROBE_CALIBRATE_BASE | ||||
| gcode: | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' | ||||
|   SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' | ||||
|   _PROBE_CALIBRATE_BASE {get_params|join(" ")} | ||||
| 
 | ||||
| 
 | ||||
| ## SET_PROBE_STATUS | ||||
| [gcode_macro SET_PROBE_STATUS] | ||||
| description: Manually specify MagProbe status, valid probe states are UNKNOWN, ATTACHED and DOCKED | ||||
| variable_state: 'unknown' | ||||
|  | @ -99,9 +219,84 @@ gcode: | |||
|     {action_raise_error("Invalid probe state: %s. Valid probe states are [UNKNOWN, ATTACHED, DOCKED]" % state|upper)} | ||||
|   {% endif %} | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Helper Macros | ||||
| ##################################################################### | ||||
| 
 | ||||
| ## _ATTACH_PROBE | ||||
| [gcode_macro _ATTACH_PROBE] | ||||
| description: Helper: Attach MagProbe | ||||
| gcode: | ||||
|   ##### Get user defines ##### | ||||
|   {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} | ||||
|   {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} | ||||
|   {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} | ||||
|   {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} | ||||
|   {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} | ||||
|   {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE | ||||
|   SET_GCODE_OFFSET Z=0.0                ; reset offset - will be restored | ||||
|   G90                                   ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     G0 Z{z_min} F1500                   ; move head up | ||||
|   {% endif %} | ||||
| 
 | ||||
|   ##### gantry dock: | ||||
|   G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe | ||||
|   G0 X{dock_x} F{d_speed}               ; move sideways to attach probe | ||||
|   G0 Y{dock_y} F{d_speed}               ; move out of holder | ||||
| 
 | ||||
|   RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE | ||||
| 
 | ||||
| 
 | ||||
| ## _DOCK_PROBE | ||||
| [gcode_macro _DOCK_PROBE] | ||||
| description: Helper: Dock MagProbe | ||||
| gcode: | ||||
|   ##### Get user defines ##### | ||||
|   {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} | ||||
|   {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} | ||||
|   {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} | ||||
|   {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} | ||||
|   {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} | ||||
|   {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE | ||||
|   SET_GCODE_OFFSET Z=0.0                ; reset offset - will be restored | ||||
|   G90                                   ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     G0 Z{z_min} F900                    ; move head up | ||||
|   {% endif %} | ||||
| 
 | ||||
|   ################################################################### | ||||
|   #        !!! Caution !!! | ||||
|   # | ||||
|   # Adapt for your needs if needed !! | ||||
|   ################################################################### | ||||
| 
 | ||||
|   ##### Example for a bed dock: | ||||
|   #G0 X{dock_x} Y{dock_y} F{t_speed}     ; move to mag-probe | ||||
|   #G0 Z{dock_z} F1500 FORCE              ; move down to probe | ||||
|   #G0 Y{undock_y} F{d_speed}             ; move into the holder | ||||
|   #G0 Z{undock_z} F1500                  ; move upwards to remove probe | ||||
| 
 | ||||
|   ##### Example for a gantry dock: | ||||
|   G0 X{dock_x} Y{dock_y} F{t_speed}     ; move in front of mag-probe | ||||
|   G0 Y{undock_y} F{d_speed}             ; move into the holder | ||||
|   G0 X{undock_x} F{d_speed}             ; move sideways to remove probe | ||||
| 
 | ||||
|   RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE | ||||
| 
 | ||||
| 
 | ||||
| ## MAG_PROBE | ||||
| # QUERY_PROBE must run direct before _PROBE_ACTION | ||||
| # that relation is insured by the caller id | ||||
| [gcode_macro _MAG_PROBE] | ||||
|  | @ -127,6 +322,8 @@ gcode: | |||
|   SET_GCODE_VARIABLE MACRO=_MAG_PROBE VARIABLE=id VALUE={id} | ||||
|   M400 | ||||
| 
 | ||||
| 
 | ||||
| ## _PROBE_ACTION | ||||
| [gcode_macro _PROBE_ACTION] | ||||
| description: Helper: Perform MagProbe action | ||||
| gcode: | ||||
|  | @ -196,164 +393,8 @@ gcode: | |||
|     {action_raise_error("MagProbe: action not defined")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| [gcode_macro _ATTACH_PROBE] | ||||
| description: Helper: Attach MagProbe | ||||
| gcode: | ||||
|   ##### Get user defines ##### | ||||
|   {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} | ||||
|   {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} | ||||
|   {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} | ||||
|   {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} | ||||
|   {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} | ||||
|   {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=STATE_ATTACH_PROBE | ||||
|   SET_GCODE_OFFSET Z=0.0                ; reset offset - will be restored | ||||
|   G90                                   ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     G0 Z{z_min} F1500                   ; move head up | ||||
|   {% endif %} | ||||
| 
 | ||||
|   ################################################################### | ||||
|   #        !!! Caution !!! | ||||
|   # | ||||
|   # Adapt for your needs if needed !! | ||||
|   ################################################################### | ||||
| 
 | ||||
|   ##### Example for a bed dock: | ||||
|   #G0 X{undock_x} Y{undock_y} F{t_speed} ; move to mag-probe | ||||
|   #G0 Z{dock_z} F1500 FORCE              ; move down to probe | ||||
|   #G0 Y{dock_y} F{d_speed}               ; move out of holder | ||||
|   #G0 Z{undock_z} F1500                  ; move head up | ||||
| 
 | ||||
|   ##### Example for a gantry dock: | ||||
|   G0 X{undock_x} Y{undock_y} F{t_speed} ; move next to mag-probe | ||||
|   G0 X{dock_x} F{d_speed}               ; move sideways to attach probe | ||||
|   G0 Y{dock_y} F{d_speed}               ; move out of holder | ||||
| 
 | ||||
|   RESTORE_GCODE_STATE NAME=STATE_ATTACH_PROBE | ||||
| 
 | ||||
| [gcode_macro _DOCK_PROBE] | ||||
| description: Helper: Dock MagProbe | ||||
| gcode: | ||||
|   ##### Get user defines ##### | ||||
|   {% set dock_x = printer['gcode_macro _USER_VARIABLE'].probe_dock_x %} | ||||
|   {% set dock_y = printer['gcode_macro _USER_VARIABLE'].probe_dock_y %} | ||||
|   {% set dock_z = printer['gcode_macro _USER_VARIABLE'].probe_dock_z %} | ||||
|   {% set undock_x = printer['gcode_macro _USER_VARIABLE'].probe_undock_x %} | ||||
|   {% set undock_y = printer['gcode_macro _USER_VARIABLE'].probe_undock_y %} | ||||
|   {% set undock_z = printer['gcode_macro _USER_VARIABLE'].probe_undock_z %} | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   {% set d_speed = printer['gcode_macro _USER_VARIABLE'].probe_dock_speed|float * 60 %} | ||||
|   ##### get toolhead position ##### | ||||
|   {% set act_z = printer.toolhead.position.z|float %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=STATE_DOCK_PROBE | ||||
|   SET_GCODE_OFFSET Z=0.0                ; reset offset - will be restored | ||||
|   G90                                   ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     G0 Z{z_min} F900                    ; move head up | ||||
|   {% endif %} | ||||
| 
 | ||||
|   ################################################################### | ||||
|   #        !!! Caution !!! | ||||
|   # | ||||
|   # Adapt for your needs if needed !! | ||||
|   ################################################################### | ||||
| 
 | ||||
|   ##### Example for a bed dock: | ||||
|   #G0 X{dock_x} Y{dock_y} F{t_speed}     ; move to mag-probe | ||||
|   #G0 Z{dock_z} F1500 FORCE              ; move down to probe | ||||
|   #G0 Y{undock_y} F{d_speed}             ; move into the holder | ||||
|   #G0 Z{undock_z} F1500                  ; move upwards to remove probe | ||||
| 
 | ||||
|   ##### Example for a gantry dock: | ||||
|   G0 X{dock_x} Y{dock_y} F{t_speed}     ; move in front of mag-probe | ||||
|   G0 Y{undock_y} F{d_speed}             ; move into the holder | ||||
|   G0 X{undock_x} F{d_speed}             ; move sideways to remove probe   | ||||
|    | ||||
|   RESTORE_GCODE_STATE NAME=STATE_DOCK_PROBE | ||||
| 
 | ||||
| ##################################################################### | ||||
| #	Customized standard macros | ||||
| ##################################################################### | ||||
| # | ||||
| #        !!! Caution !!! | ||||
| # | ||||
| # PROBE_CALIBRATE can not dock the Magprobe automatically, as it  | ||||
| # start's a scripting process we need to stop at the execution  | ||||
| # of the base macro. Use  | ||||
| #  - PROBE_ABORT | ||||
| #  - PROBE_ACCEPT | ||||
| # instead of the original ABORT and ACCEPT to also dock the probe | ||||
| # | ||||
| ##################################################################### | ||||
| # | ||||
| # If your probe needs a Z move for attach/detach use either | ||||
| #   G0 .... FORCE | ||||
| #   G1 .... FORCE | ||||
| # | ||||
| ##################################################################### | ||||
| [gcode_macro G0] | ||||
| description: Move gcode that prevents moves lower than the limit when probe attached | ||||
| rename_existing: G0.1 | ||||
| gcode: | ||||
|   ##### set manual override ##### | ||||
|   {% if 'FORCE' in params|upper %} | ||||
|     {% set force = 1 %} | ||||
|   {% else %} | ||||
|     {% set force = 0 %} | ||||
|   {% endif %} | ||||
|   ##### get params ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter | ||||
|       {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|     {% endif %} | ||||
|   {% endfor %} | ||||
|   ##### add caller ##### | ||||
|   {% set tmp = get_params.append("CALLER=G0") %} ;hack to append list objects outside of a loop | ||||
|   ##### add force ##### | ||||
|   {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop | ||||
|   ##### end of definition ##### | ||||
|   {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} | ||||
|     _MAG_PROBE ACTION=GET_STATUS RESPOND=0 | ||||
|   {% endif %} | ||||
|   _Z_MOVE_CHECK {get_params|join(" ")} | ||||
| 
 | ||||
| [gcode_macro G1] | ||||
| description: Move gcode that prevents moves lower than the limit when probe attached | ||||
| rename_existing: G1.1 | ||||
| gcode: | ||||
|   ##### set manual override ##### | ||||
|   {% if 'FORCE' in params|upper %} | ||||
|     {% set force = 1 %} | ||||
|   {% else %} | ||||
|     {% set force = 0 %} | ||||
|   {% endif %} | ||||
|   ##### get params ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% if key is not in ['G', 'FORCE'] %} ;G1/G0 is also seen as parameter | ||||
|       {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|     {% endif %} | ||||
|   {% endfor %} | ||||
|   ##### add caller ##### | ||||
|   {% set tmp = get_params.append("CALLER=G1") %} ;hack to append list objects outside of a loop | ||||
|   ##### add force ##### | ||||
|   {% set tmp = get_params.append("FORCE=" + force|string) %} ;hack to append list objects outside of a loop | ||||
|   ##### end of definition ##### | ||||
|   {% if printer['gcode_macro _MAG_PROBE'].state|lower == 'unknown' and force == 0 %} | ||||
|     _MAG_PROBE ACTION=GET_STATUS RESPOND=0 | ||||
|   {% endif %} | ||||
|   _Z_MOVE_CHECK {get_params|join(" ")} | ||||
| 
 | ||||
| ## _Z_MOVE_CHECK | ||||
| [gcode_macro _Z_MOVE_CHECK] | ||||
| description: Helper: Check limit and perform move | ||||
| gcode: | ||||
|  | @ -397,171 +438,3 @@ gcode: | |||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   {caller}.1 {get_params|join(" ")} | ||||
| 
 | ||||
| [gcode_macro QUERY_PROBE] | ||||
| description: Return the status of the z-probe and store ID | ||||
| rename_existing: QUERY_PROBE_BASE | ||||
| variable_id: 0 | ||||
| gcode: | ||||
|   {% set id = params.ID|default(0) %} ; call id 0 means invalid | ||||
|   QUERY_PROBE_BASE | ||||
|   SET_GCODE_VARIABLE MACRO=QUERY_PROBE VARIABLE=id VALUE={id} | ||||
| 
 | ||||
| [gcode_macro PROBE_ACCURACY] | ||||
| description: Probe Z-height accuracy at current XY position and dock/undock MagProbe | ||||
| rename_existing: PROBE_ACCURACY_BASE | ||||
| gcode: | ||||
|   #####  get new parameter. ##### | ||||
|   {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE_ACCURACY: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE_ACCURACY | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} | ||||
|   PROBE_ACCURACY_BASE {get_params|join(" ")} | ||||
|   {% if dock == 1 %} | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_ACCURACY MOVE=1 MOVE_SPEED={t_speed} | ||||
|   {% endif %} | ||||
|   {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|    | ||||
| [gcode_macro PROBE] | ||||
| description: Probe Z-height at current XY position and dock/undock MagProbe | ||||
| rename_existing: PROBE_BASE | ||||
| gcode: | ||||
|   #####  get new parameter. ##### | ||||
|   {% set dock = params.DOCK|default(1)|int %} ; use DOCK=0 to omit the probe docking | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   PROBE_BASE {get_params|join(" ")} | ||||
|   G1 Z{z_min} F900 ; move head up to remove trigger | ||||
|   {% if dock == 1 %} | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   {% endif %} | ||||
|   {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|    | ||||
| [gcode_macro PROBE_CALIBRATE] | ||||
| description: Calibrate the probes z_offset and undock MagProbe | ||||
| rename_existing: PROBE_CALIBRATE_BASE | ||||
| gcode: | ||||
|   ##### get user defines  ##### | ||||
|   {% set z_min = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   {% set absolute_coordinates = printer.gcode_move.absolute_coordinates|lower %} | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   # as we need to return to the position with the probe we need to be at least at z_min | ||||
|   G90 ; absolute positioning | ||||
|   {% if act_z < z_min %} | ||||
|     {action_respond_info("PROBE_CALIBRATE: High must be above %.2f" % z_min)} | ||||
|     G1 Z{z_min} F900 ; move head up | ||||
|   {% endif %} | ||||
|   M400 ; get the buffer cleared first | ||||
|   SAVE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE | ||||
|   ATTACH_PROBE | ||||
|   RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|   SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"calib"' | ||||
|   SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=absolute_coordinates VALUE='"{absolute_coordinates}"' | ||||
|   PROBE_CALIBRATE_BASE {get_params|join(" ")} | ||||
|    | ||||
| [gcode_macro BED_MESH_CALIBRATE] | ||||
| description: Perform QGL and bed mesh leveling | ||||
| rename_existing: BED_MESH_CALIBRATE_BASE | ||||
| gcode: | ||||
|   ##### get params and prepare to send them to the base macro ##### | ||||
|   {% set get_params = [] %} | ||||
|   {% for key in params %} | ||||
|     {% set get_params = get_params.append(key + "=" + params[key])  %} | ||||
|   {% endfor %} | ||||
|   ##### end of definitions ##### | ||||
|   _CG28 | ||||
|   BED_MESH_CLEAR | ||||
|   ## check if QGL was already executed | ||||
|   {% if printer.quad_gantry_level.applied|lower == 'false' %} | ||||
|     QUAD_GANTRY_LEVEL PARK=false | ||||
|   {% endif %} | ||||
|   ATTACH_PROBE | ||||
|   BED_MESH_CALIBRATE_BASE {get_params|join(" ")} | ||||
|   DETACH_PROBE | ||||
| 
 | ||||
| [gcode_macro PROBE_ABORT] | ||||
| description: Abort manual Z probing tool for Probe and dock MagProbe | ||||
| variable_caller: 'unknown' | ||||
| variable_absolute_coordinates: False | ||||
| gcode: | ||||
|   ##### get user defines  ##### | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### end of definitions ##### | ||||
|   {% if caller|lower|string == 'calib' %} | ||||
|     ABORT | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|     {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|       SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' | ||||
|   {% else %} | ||||
|     {action_respond_info("PROBE_ABORT: Executed while PROBE_CALIBRATE is not running")} | ||||
|   {% endif %} | ||||
| 
 | ||||
| [gcode_macro PROBE_ACCEPT] | ||||
| description: Accept the current Z position for Probe and dock MagProbe | ||||
| gcode: | ||||
|   #####  get variables from ABORT  ##### | ||||
|   {% set caller = printer['gcode_macro PROBE_ABORT'].caller %} | ||||
|   {% set absolute_coordinates = printer['gcode_macro PROBE_ABORT'].absolute_coordinates %} | ||||
|   ##### get user defines  ##### | ||||
|   {% set t_speed = printer['gcode_macro _USER_VARIABLE'].probe_travel_speed|float * 60 %} | ||||
|   ##### end of definitions ##### | ||||
|   {% if caller|lower|string == 'calib' %} | ||||
|     ACCEPT | ||||
|     DETACH_PROBE | ||||
|     RESTORE_GCODE_STATE NAME=STATE_PROBE_CALIBRATE MOVE=1 MOVE_SPEED={t_speed} | ||||
|     {% if absolute_coordinates == 'false' %} G91 {% endif %} | ||||
|       SET_GCODE_VARIABLE MACRO=PROBE_ABORT VARIABLE=caller VALUE='"unknown"' | ||||
|   {% else %} | ||||
|     {action_respond_info("PROBE_ACCEPT: Executed while PROBE_CALIBRATE is not running")} | ||||
|   {% endif %} | ||||
| 
 | ||||
|  | @ -1,68 +1,76 @@ | |||
| ##################################################################### | ||||
| #    Homing definition | ||||
| # Macros for z-calibration | ||||
| # - CALIBRATE_Z | ||||
| # - _CG28 | ||||
| # - _SET_CURRENT | ||||
| # - _SET_ACC | ||||
| ##################################################################### | ||||
| [homing_override] | ||||
| axes: z | ||||
| set_position_z: 0 | ||||
| 
 | ||||
| 
 | ||||
| ## CALIBRATE_Z | ||||
| [gcode_macro CALIBRATE_Z] | ||||
| description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe | ||||
| rename_existing: _CALIBRATE_Z_BASE | ||||
| gcode: | ||||
|   ##### get user defines  ##### | ||||
|   # use -10 as default to insure it error in case the variable is not existing | ||||
|   {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} | ||||
|   {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=HOMING_state | ||||
| 
 | ||||
|   ## reduce current of Z motors | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   #### end of definitions ##### | ||||
|   ## reduce current of motors | ||||
|   _SET_ACC VAL=HOME | ||||
|   _SET_CURRENT VAL=HOME | ||||
|      | ||||
|   G91                            ; relative positioning | ||||
|   # G0 Z10 F1500 | ||||
|   G0 Z10 F1300 | ||||
|   _CG28 RESET_SETTINGS=false | ||||
|   {% if act_z < z_hop %} | ||||
|     G90 ; absolute positioning | ||||
| 
 | ||||
|   # Home X and Y only for G28 or G28 XYZ | ||||
|   {% if 'Z' in params %} | ||||
|     {% if "x" not in printer.toolhead.homed_axes %} | ||||
|       G28 X | ||||
|     {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} | ||||
|     G1 Z{z_hop} F900 ; move head up | ||||
|   {% endif %} | ||||
|     {% if "y" not in printer.toolhead.homed_axes %} | ||||
|       G28 Y | ||||
|     {% endif %} | ||||
|   {% else %} | ||||
|     G28 X Y | ||||
|   {% endif %}  | ||||
| 
 | ||||
|   ##	XY Location of the Z Endstop Switch | ||||
|   G0 X{z_endstop_x} Y{z_endstop_y} F12000 | ||||
|   G28 Z                          ; home Z | ||||
|   # G0 Z2 F1500                   ; move up | ||||
|   G0 Z2 F1300                   ; move up | ||||
| 
 | ||||
|   ## return to org current settings | ||||
|   #ATTACH_PROBE ; if not using start_gcode | ||||
|   _CALIBRATE_Z_BASE | ||||
|   #DETACH_PROBE ; if not using end_gcode | ||||
|   {% if params.RESET_SETTINGS|default('true') == 'true' %} | ||||
|     DETACH_PROBE | ||||
|     ## return to org current settings | ||||
|     _SET_CURRENT | ||||
|     _SET_ACC | ||||
|   {% endif %} | ||||
| 
 | ||||
|   # Lift Z | ||||
|   # G0 Z{z_hop} F1800 | ||||
|   G0 Z{z_hop} F1300 | ||||
| 
 | ||||
|   RESTORE_GCODE_STATE NAME=HOMING_state | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Macros | ||||
| ##################################################################### | ||||
| ## conditional home | ||||
| ## _CG28 | ||||
| [gcode_macro _CG28] | ||||
| description: conditional home | ||||
| gcode: | ||||
|   {% if "xyz" not in printer.toolhead.homed_axes %} | ||||
|     G28 RESET_SETTINGS={ params.RESET_SETTINGS|default('true') } | ||||
|   {% endif %} | ||||
| 
 | ||||
| ## _SET_ACC | ||||
| [gcode_macro _SET_ACC] | ||||
| description: Helper: Set accel and accel_to_decel value | ||||
| variable_last_val: 'CONFIG' | ||||
| gcode: | ||||
|   ##### set default value ##### | ||||
|   {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} | ||||
|   {% set val = params.VAL|default('CONFIG') %} | ||||
|   {% set respond = params.RESPOND|default(default_respond)|int %} | ||||
|   {% if val == 'HOME' %} | ||||
|     {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} | ||||
|     {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} | ||||
|   {% else %} | ||||
|     {% set accel = printer.configfile.settings.printer.max_accel %} | ||||
|     {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} | ||||
|   {% endif %} | ||||
|   ##### end of definition ##### | ||||
|   {% if val != last_val %} | ||||
|     SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' | ||||
|     {% if respond == 1 %} | ||||
|       {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} | ||||
|     {% endif %} | ||||
|     SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| ## _SET_CURRENT | ||||
| [gcode_macro _SET_CURRENT] | ||||
| description: Helper: Set Z-drive motor current | ||||
| variable_last_val: 'CONFIG' | ||||
|  | @ -103,27 +111,3 @@ gcode: | |||
|     SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} | ||||
|     M400 | ||||
|   {% endif %} | ||||
| 
 | ||||
| [gcode_macro _SET_ACC] | ||||
| description: Helper: Set accel and accel_to_decel value | ||||
| variable_last_val: 'CONFIG' | ||||
| gcode: | ||||
|   ##### set default value ##### | ||||
|   {% set default_respond = printer['gcode_macro _USER_VARIABLE'].respond_set_acc|int %} | ||||
|   {% set val = params.VAL|default('CONFIG') %} | ||||
|   {% set respond = params.RESPOND|default(default_respond)|int %} | ||||
|   {% if val == 'HOME' %} | ||||
|     {% set accel = printer['gcode_macro _USER_VARIABLE'].home_accel %} | ||||
|     {% set accel_to_decel = printer['gcode_macro _USER_VARIABLE'].home_accel|int / 2 %} | ||||
|   {% else %} | ||||
|     {% set accel = printer.configfile.settings.printer.max_accel %} | ||||
|     {% set accel_to_decel = printer.configfile.settings.printer.max_accel_to_decel %} | ||||
|   {% endif %} | ||||
|   ##### end of definition ##### | ||||
|   {% if val != last_val %} | ||||
|     SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{val}"' | ||||
|     {% if respond == 1 %} | ||||
|       {action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))} | ||||
|     {% endif %} | ||||
|     SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel} RESPOND=0 | ||||
|   {% endif %} | ||||
							
								
								
									
										62
									
								
								printer.cfg
									
										
									
									
									
								
							
							
						
						
									
										62
									
								
								printer.cfg
									
										
									
									
									
								
							|  | @ -32,6 +32,25 @@ restart_method: command | |||
| ##-------------------------------------------------------------------- | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro zc] | ||||
| gcode: | ||||
|   {% set z_run = params.CUR|default(0.4)|float %} | ||||
|   {% set z_hold = z_run %} | ||||
|   {action_respond_info("zc: setting zcurrent to %.2f" % z_run)} | ||||
|   SET_TMC_CURRENT STEPPER=stepper_z  CURRENT={z_run} HOLDCURRENT={z_hold} | ||||
|   SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={z_run} HOLDCURRENT={z_hold} | ||||
|   SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT={z_run} HOLDCURRENT={z_hold} | ||||
|   SET_TMC_CURRENT STEPPER=stepper_z3 CURRENT={z_run} HOLDCURRENT={z_hold} | ||||
| 
 | ||||
| 
 | ||||
| [gcode_macro zm] | ||||
| gcode: | ||||
|   {% set speed = params.SPEED|default(300)|int %} | ||||
|   {action_respond_info("moving with F%d" % speed)} | ||||
|   G0 Z30 F{speed} | ||||
|   G0 Z10 F{speed} | ||||
| 
 | ||||
| 
 | ||||
| [printer] | ||||
| kinematics: corexy | ||||
| max_velocity: 300 | ||||
|  | @ -51,7 +70,7 @@ square_corner_velocity: 5.0 | |||
| ##################################################################### | ||||
| 
 | ||||
| [include fluidd.cfg] | ||||
| [include macros.cfg] | ||||
| [include macros/_init.cfg] | ||||
| [include neopixel.cfg] | ||||
| [include fans.cfg] | ||||
| [include input_shaper.cfg] | ||||
|  | @ -75,7 +94,7 @@ endstop_pin: PG6 | |||
| position_min: 0 | ||||
| position_endstop: 300 | ||||
| position_max: 300 | ||||
| homing_speed: 30              # Max 100 | ||||
| homing_speed: 30          # speed: mm/sec, feedrate: mm/min | ||||
| homing_retract_dist: 5 | ||||
| homing_positive_dir: true | ||||
| 
 | ||||
|  | @ -96,7 +115,7 @@ rotation_distance: 40 | |||
| microsteps: 16 | ||||
| full_steps_per_rotation: 400  # 200: 1.8 deg stepper, 400: 0.9 deg stepper | ||||
| endstop_pin: PG9 | ||||
| position_min: 15              # Camera | ||||
| position_min: 0 | ||||
| position_endstop: 305 | ||||
| position_max: 305 | ||||
| homing_speed: 30              # Max 100 | ||||
|  | @ -125,16 +144,13 @@ rotation_distance: 40 | |||
| gear_ratio: 80:16 | ||||
| microsteps: 16 | ||||
| endstop_pin: PG10 | ||||
| ## 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: -0.5 | ||||
| ## actual_position = measured_position_endstop - position_endstop | ||||
| position_endstop: 0.5 | ||||
| position_max: 290 | ||||
| position_min: -5 | ||||
| homing_speed: 11.0          # speed: mm/sec, feedrate: mm/min | ||||
| second_homing_speed: 3 | ||||
| homing_retract_dist: 3 | ||||
| homing_speed: 13.0          # speed: mm/sec, feedrate: mm/min | ||||
| second_homing_speed: 4 | ||||
| homing_retract_dist: 13 | ||||
| 
 | ||||
| [tmc2209 stepper_z] | ||||
| uart_pin: PC6 | ||||
|  | @ -276,7 +292,7 @@ max_temp: 120 | |||
| pin: ^PG11 | ||||
| x_offset: 0 | ||||
| y_offset: 25.0 | ||||
| #z_offset: 0 | ||||
| z_offset: 10 | ||||
| speed: 6 | ||||
| lift_speed: 11 | ||||
| samples: 5 | ||||
|  | @ -329,7 +345,7 @@ timeout: 1800 | |||
| ## replaced with homing_override in klicky-probe.cfg | ||||
| # [safe_z_home] | ||||
| # ## XY Location of the Z Endstop Switch | ||||
| # home_xy_position: 208, 305 | ||||
| # home_xy_position: 205, 305 | ||||
| # speed: 100 | ||||
| # z_hop: 10 | ||||
| # z_hop_speed: 25 | ||||
|  | @ -356,9 +372,9 @@ points: | |||
|   50,225 | ||||
|   250,225 | ||||
|   250,40 | ||||
| speed: 100 | ||||
| speed: 150 | ||||
| horizontal_move_z: 15 | ||||
| retries: 8 | ||||
| retries: 5 | ||||
| retry_tolerance: 0.0075 | ||||
| max_adjust: 10 | ||||
| 
 | ||||
|  | @ -380,11 +396,11 @@ max_adjust: 10 | |||
| #*# [bed_mesh default] | ||||
| #*# version = 1 | ||||
| #*# points = | ||||
| #*# 	-0.002500, -0.015000, -0.002500, -0.005000, -0.045000 | ||||
| #*# 	-0.000000, -0.012500, 0.002500, -0.005000, -0.040000 | ||||
| #*# 	-0.002500, 0.002500, 0.000000, 0.012500, -0.032500 | ||||
| #*# 	-0.012500, -0.007500, 0.025000, 0.017500, 0.000000 | ||||
| #*# 	0.057500, 0.072500, 0.042500, 0.075000, 0.027500 | ||||
| #*# 	  -0.032500, 0.002500, 0.015000, 0.015000, -0.042500 | ||||
| #*# 	  -0.032500, -0.015000, 0.002500, 0.002500, -0.055000 | ||||
| #*# 	  -0.040000, -0.015000, 0.000000, 0.000000, -0.060000 | ||||
| #*# 	  -0.030000, -0.022500, 0.010000, 0.010000, -0.055000 | ||||
| #*# 	  0.075000, 0.015000, 0.052500, 0.055000, -0.007500 | ||||
| #*# tension = 0.2 | ||||
| #*# min_x = 40.0 | ||||
| #*# algo = bicubic | ||||
|  | @ -395,9 +411,3 @@ max_adjust: 10 | |||
| #*# max_y = 280.0 | ||||
| #*# mesh_x_pps = 2 | ||||
| #*# max_x = 260.0 | ||||
| #*# | ||||
| #*# [stepper_z] | ||||
| #*# position_endstop = 0.817 | ||||
| #*# | ||||
| #*# [probe] | ||||
| #*# z_offset = 7.660 | ||||
|  |  | |||
|  | @ -53,7 +53,8 @@ camera_usb_options="-r 800x600 -f 10" | |||
| # Defaults to 10fps | ||||
| # | ||||
| # camera_raspi_options="-fps 10" | ||||
| camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" | ||||
| # camera_raspi_options="-rot 180 -x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" | ||||
| camera_raspi_options="-x 800 -y 600 -fps 10 -roi 0.0,0.0,0.998,1" | ||||
| 
 | ||||
| ### Configuration of camera HTTP output | ||||
| # | ||||
|  |  | |||
|  | @ -4,21 +4,21 @@ | |||
| [gcode_macro _USER_VARIABLE] | ||||
| description: Helper: Contains User defined printer variables | ||||
| ##### Homing and general movement ##### | ||||
| variable_z_endstop_x: 208             ; z Endstop x position inside right profile | ||||
| variable_z_endstop_x: 205             ; z Endstop x position inside right profile | ||||
| variable_z_endstop_y: 305             ; z Endstop y position | ||||
| variable_z_hop: 15.0                  ; z hop for moves e.g homing | ||||
| variable_xy_home_current: 0.4         ; reduced homing current for x and y | ||||
| variable_z_home_current: 0.3          ; reduced homing current for z | ||||
| variable_z_hop: 10.0                  ; z hop for moves e.g homing | ||||
| variable_xy_home_current: 0.5         ; reduced homing current for x and y | ||||
| variable_z_home_current: 0.4          ; reduced homing current for z | ||||
| variable_home_accel: 1000             ; reduced ACCEL for homing | ||||
| ##### Mag Probe ##### | ||||
| variable_probe_dock_x: 148            ; x toolhead position before docking probe | ||||
| variable_probe_dock_x: 145            ; x toolhead position before docking probe | ||||
| variable_probe_dock_y: 285            ; y toolhead position before docking probe | ||||
| variable_probe_dock_z: 15             ; z toolhead position before docking probe (only for bed dock) | ||||
| variable_probe_dock_z: 10             ; z toolhead position before docking probe (only for bed dock) | ||||
| variable_probe_undock_x: 200          ; x toolhead position after docking probe | ||||
| variable_probe_undock_y: 305          ; y toolhead position after docking probe | ||||
| variable_probe_undock_z: 15           ; z toolhead position after docking probe (only for bed dock) | ||||
| variable_probe_z_min: 15              ; z minimum height to avoid crash | ||||
| variable_probe_travel_speed: 200      ; dock moves travel speed | ||||
| variable_probe_undock_z: 10           ; z toolhead position after docking probe (only for bed dock) | ||||
| variable_probe_z_min: 10              ; z minimum height to avoid crash | ||||
| variable_probe_travel_speed: 100      ; dock moves travel speed | ||||
| variable_probe_dock_speed: 100        ; dock speed for attach/dock | ||||
| ##### Respond defaults ##### | ||||
| variable_respond_set_current: 0       ; default of RESPOND if not set in the call | ||||
|  | @ -28,21 +28,14 @@ variable_respond_probe_action: 1      ; default of RESPOND if not set in the cal | |||
| variable_park_bed: [280,280,30]       ; different park position | ||||
| gcode: | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Includes | ||||
| ##################################################################### | ||||
| [include z_calibration/macros.cfg] | ||||
| [include z_calibration/homing.cfg] | ||||
| [include z_calibration/probing.cfg] | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Z Calibration | ||||
| ##################################################################### | ||||
| 
 | ||||
| [z_calibration] | ||||
| #   The X and Y coordinates (in mm) for clicking the nozzle on the | ||||
| #   Z endstop. | ||||
| probe_nozzle_x: 208 | ||||
| probe_nozzle_x: 205 | ||||
| probe_nozzle_y: 305 | ||||
| #   The X and Y coordinates (in mm) for clicking the probe's switch | ||||
| #   on the Z endstop. | ||||
|  | @ -59,7 +52,7 @@ probe_bed_y: 150 | |||
| #   The trigger point offset of the used mag-probe switch. | ||||
| #   This needs to be fined out manually. More on this later | ||||
| #   in this section. smaller switch_offset -> more distance to  the build plate | ||||
| switch_offset: 0.73 | ||||
| switch_offset: 0.75 | ||||
| #   The maximum allowed deviation of the calculated offset. | ||||
| #   If the offset exceeds this value, it will stop! | ||||
| #   The default is 1.0 mm. | ||||
|  | @ -99,66 +92,73 @@ max_deviation: 1.0 | |||
| #   This is to get faster down and the result is not recorded as a | ||||
| #   probing sample. The default is false. | ||||
| probing_first_fast: true | ||||
| #   If true, the first probing is done faster by the probing speed. | ||||
| #   This is to get faster down and the result is not recorded as a | ||||
| #   probing sample. The default is false. | ||||
| start_gcode: DETACH_PROBE | ||||
| #   A list of G-Code commands to execute prior to each calibration command. | ||||
| #   See docs/Command_Templates.md for G-Code format. This can be used to | ||||
| #   attach the probe. | ||||
| before_switch_gcode: ATTACH_PROBE | ||||
| #   See docs/Command_Templates.md for G-Code format. | ||||
| #   This can be used to attach the probe. | ||||
| start_gcode: ATTACH_PROBE | ||||
| #   A list of G-Code commands to execute prior to each probing on the | ||||
| #   mag-probe. See docs/Command_Templates.md for G-Code format. This can be | ||||
| #   used to attach the probe after probing on the nozzle and before probing | ||||
| #   on the mag-probe. | ||||
| end_gcode: DETACH_PROBE | ||||
| #   mag-probe. See docs/Command_Templates.md for G-Code format. | ||||
| #   This can be used to attach the probe after probing on the nozzle and | ||||
| #   before probing on the mag-probe. | ||||
| before_switch_gcode: ATTACH_PROBE | ||||
| #   A list of G-Code commands to execute after each calibration command. | ||||
| #   See docs/Command_Templates.md for G-Code format. This can be used to | ||||
| #   detach the probe afterwards. | ||||
| 
 | ||||
| ##################################################################### | ||||
| ## With these settings, the probe is attached after probing the nozzle | ||||
| ## and before probing the switch !! | ||||
| ##################################################################### | ||||
| ## Otherwise, starting with the probe attached would be like this: | ||||
| start_gcode: ATTACH_PROBE | ||||
| #before_switch_gcode: ATTACH_PROBE | ||||
| end_gcode: DETACH_PROBE | ||||
| ##################################################################### | ||||
| 
 | ||||
| 
 | ||||
| ##################################################################### | ||||
| #    Macros | ||||
| #    Homing definition | ||||
| ##################################################################### | ||||
| 
 | ||||
| ################################################################### | ||||
| #        !!! Caution !!! | ||||
| # | ||||
| # This Macro is only needed if not using the start/end_gcode | ||||
| # properties to attach/detach the probe | ||||
| ################################################################### | ||||
| [gcode_macro CALIBRATE_Z] | ||||
| description: Automatically calibrates the nozzles offset to the print surface and dock/undock MagProbe | ||||
| rename_existing: CALIBRATE_Z_BASE | ||||
| [homing_override] | ||||
| axes: z | ||||
| set_position_z: 0 | ||||
| gcode: | ||||
|   ##### get user defines ##### | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].probe_z_min|float %} | ||||
|   ##### get toolhead parameters ##### | ||||
|   {% set act_z = printer.gcode_move.gcode_position.z|float %} | ||||
|   #### end of definitions ##### | ||||
|   ## reduce current of motors | ||||
|   # use -10 as default to insure it error in case the variable is not existing | ||||
|   {% set z_endstop_x = printer['gcode_macro _USER_VARIABLE'].z_endstop_x|default(-10) %} | ||||
|   {% set z_endstop_y = printer['gcode_macro _USER_VARIABLE'].z_endstop_y|default(-10) %} | ||||
|   {% set z_hop = printer['gcode_macro _USER_VARIABLE'].z_hop %} | ||||
|   ##### end of definitions ##### | ||||
|   SAVE_GCODE_STATE NAME=HOMING_state | ||||
| 
 | ||||
|   ## reduce current of Z motors | ||||
|   _SET_ACC VAL=HOME | ||||
|   _SET_CURRENT VAL=HOME | ||||
|   _CG28 RESET_SETTINGS=false | ||||
|   {% if act_z < z_hop %} | ||||
| 
 | ||||
|   G91                           ; relative positioning | ||||
|   G0 Z10 F1500                  ; move z 10 up | ||||
|   G90                           ; absolute positioning | ||||
|     {action_respond_info("CALIBRATE_Z: High must be above %.2f" % z_hop)} | ||||
|     G1 Z{z_hop} F900 ; move head up | ||||
| 
 | ||||
|   # Home X and Y only for G28 or G28 XYZ | ||||
|   {% if 'Z' in params %} | ||||
|     {% if "x" not in printer.toolhead.homed_axes %} | ||||
|       G28 X | ||||
|     {% endif %} | ||||
|   #ATTACH_PROBE | ||||
|   CALIBRATE_Z_BASE | ||||
|   #DETACH_PROBE | ||||
|   {% if params.RESET_SETTINGS|default('true') == 'true' %} | ||||
|     {% if "y" not in printer.toolhead.homed_axes %} | ||||
|       G28 Y | ||||
|     {% endif %} | ||||
|   {% else %} | ||||
|     G28 X Y | ||||
|   {% endif %} | ||||
| 
 | ||||
|   ## XY Location of the Z Endstop Switch | ||||
|   # TODO check speed | ||||
|   # G0 X{z_endstop_x} Y{z_endstop_y} F12000 | ||||
|   G0 X{z_endstop_x} Y{z_endstop_y} F6000 | ||||
|   G28 Z                          ; home Z | ||||
|   G0 Z2 F1500                   ; move up | ||||
| 
 | ||||
|   ## return to org current settings | ||||
|   {% if params.RESET_SETTINGS|default('true') == 'true' %} | ||||
|     DETACH_PROBE | ||||
|     _SET_CURRENT | ||||
|     _SET_ACC | ||||
|   {% endif %} | ||||
| 
 | ||||
|   # Lift Z | ||||
|   # TODO check speed | ||||
|   # G0 Z{z_hop} F1800 | ||||
|   G0 Z{z_hop} F1300 | ||||
| 
 | ||||
|   RESTORE_GCODE_STATE NAME=HOMING_state | ||||
|  |  | |||
|  | @ -1,11 +0,0 @@ | |||
| # Sample Configuration | ||||
| 
 | ||||
| This are some parts of my V2 300 configurations describing all the mag-probe, probing | ||||
| and QGL stuff. | ||||
| 
 | ||||
| These configurations are the essence of the overall configuration from | ||||
| [zellneralex](https://github.com/zellneralex/klipper_config/tree/master) | ||||
| which is really well done !! Have a look if you want to take all of it! | ||||
| 
 | ||||
| **CAUTION: Please, don't just copy it - understand and adapt for your needs instead! | ||||
| Use this on your own risk!** | ||||
|  | @ -1,48 +0,0 @@ | |||
| # ##################################################################### | ||||
| # #    Macros | ||||
| # ##################################################################### | ||||
| # [gcode_macro PRINT_START] | ||||
| # gcode: | ||||
| #     {% set bed_temp = params.BED_TEMP|default(100)|float %} | ||||
| #     {% set extruder_temp = params.EXTRUDER_TEMP|default(220)|float %} | ||||
| #     {% set z_adjust = params.Z_ADJUST|default(0.0)|float %} | ||||
| #     {% set retract = 10 %} | ||||
| #     BED_MESH_CLEAR                    ; clear mesh | ||||
| #     _CG28                             ; Home the printer | ||||
| #     G90                               ; Use absolute coordinates | ||||
| #     PARKCENTER                        ; Move to center | ||||
| #     M117 Heating.. | ||||
| #     _HEATER_ON | ||||
| #     M106 S255                         ; set print fan to full speed | ||||
| #     M140 S{bed_temp}                  ; Start bed heating | ||||
| #     M190 S{bed_temp}                  ; Wait for bed to reach temperature | ||||
| #     M109 S{extruder_temp}             ; Set and wait for nozzle to reach temperature | ||||
| #     M107                              ; turn print fan off | ||||
| #     QUAD_GANTRY_LEVEL PARK=false | ||||
| #     M109 S{extruder_temp}             ; Set and wait for nozzle to reach temperature | ||||
| #     clean_nozzle                      ; clean nozzle | ||||
| #     CALIBRATE_Z | ||||
| #     #BED_MESH_PROFILE LOAD=default   ; load mesh if needed | ||||
| #     # Adjust the G-Code Z offset with the Z_ADJUST parameter if needed | ||||
| #     #SET_GCODE_OFFSET Z_ADJUST={z_adjust} MOVE=1 | ||||
| #     M117 Intro Line.. | ||||
| #     G90                               ; Use absolute coordinates | ||||
| #     G1 Y0 X130 Z5 F12000              ; Move the nozzle to the front and near the bed | ||||
| #     G1 Z0.7 F300                      ; Move the nozzle very close to the bed | ||||
| #     G92 E0.0                          ; set extruder position to 0 | ||||
| #     G1 E{retract} F3600               ; extrude retract | ||||
| #     G92 E0.0                          ; set extruder option to 0 | ||||
| #     G1 X180 E15.0 F500.0              ; intro line | ||||
| #     G92 E0.0                          ; set extruder Poisson to 0 | ||||
| #     G1 X174 F6000                     ; move away from intro line | ||||
| #     M117 | ||||
| # | ||||
| # [gcode_macro PARKCENTER] | ||||
| # gcode: | ||||
| #     {% set Z = params.Z|default(30)|float %} | ||||
| #     SAVE_GCODE_STATE NAME=PARKCENTER_state | ||||
| #     _CG28                          ; Home if not already homed | ||||
| #     G90                            ; absolute positioning | ||||
| #     G0 X150 Y150 Z{Z} F12000       ; move to center | ||||
| #     RESTORE_GCODE_STATE NAME=PARKCENTER_state | ||||
| # | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue