Last active
April 19, 2023 11:35
-
-
Save LauOtero/0a5729ff68c75b983170a049b80eeaee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[gcode_macro START_PRINT] | |
description: Uso: PRINT_START TEMP_EXTRUDER=<[TempI] | [Temp1C , TempI]> TEMP_BED=<[TempI] | [Temp1C , TempI]>\n Opcionales\n Temp Cabina TEMP_CHAMBER=[TempCab]\n mallado inteligente PRINT_MIN=[MINX,MINY] PRINT_MAX=[MAXX,MAXY] | |
gcode: | |
{% if params.TEMP_EXTRUDER and params.TEMP_BED %} | |
{% set vg = printer["gcode_macro _VAR_GLOBALS"] %} ; se accede a las variables globales | |
# El parametro TEMP_EXTRUDER se puede utilizar con un valor como con dos valores separados por una coma y entre [] | |
# TEMP_EXTRUDER=250 (unico valor para ambas variables(temperatura primera capa e impresion)) | |
# TEMP_EXTRUDER=260, 250 (cada variable tiene su valor(temperatura primera capa e impresion)) | |
{% if ',' in params.TEMP_EXTRUDER %} | |
# Los valores corresponden a temperatura de la primera capa e impresion. | |
{% set t_fl_extruder = params.TEMP_EXTRUDER.split(",")[0]|float %} ; Temperatura Primera capa EXTRUSOR | |
{% set t_extruder = params.TEMP_EXTRUDER.split(",")[1]|float %} ; Temperatura EXTRUSOR | |
{% else %} | |
# Si solo se asigna un valor es el mismo para ambas variables. | |
{% set t_fl_extruder = params.TEMP_EXTRUDER|float %} ; Temperatura Primera capa EXTRUSOR | |
{% set t_extruder = t_fl_extruder %} ; Temperatura EXTRUSOR | |
{% endif %} | |
# El parametro TEMP_BED se puede utilizar con un valor como con dos valores separados por una coma y entre [], | |
# TEMP_BED=100 (unico valor para ambas variables(temperatura primera capa cama e impresion cama)) | |
# TEMP_BED=110, 100 (cada variable tiene su valor(temperatura primera capa cam e impresion cama)) | |
{% if ',' in params.TEMP_BED %} | |
# Los valores corresponden a temperatura de la primera capa e impresion. | |
{% set t_fl_bed = params.TEMP_BED.split(",")[0]|float %} ; Temperatura Primera capa CAMA | |
{% set t_bed = params.TEMP_BED.split(",")[1]|float %} ; Temperatura CAMA | |
{% else %} | |
# Si solo se asigna un valor es el mismo para ambas variables. | |
{% set t_fl_bed = params.TEMP_BED|float %} ; Temperatura Primera capa EXTRUSOR | |
{% set t_bed = t_fl_bed %} ; Temperatura EXTRUSOR | |
{% endif %} | |
{% set t_chamber = params.TEMP_CHAMBER|default(0)|float %} ; Temperatura CABINA | |
# | |
# Se almacen las temperaturas de impresion en las variables globales | |
# | |
SET_GCODE_VARIABLE MACRO=_VAR_GLOBALS VARIABLE=temp_extruder VALUE={t_extruder} | |
SET_GCODE_VARIABLE MACRO=_VAR_GLOBALS VARIABLE=temp_bed VALUE={t_bed} | |
SET_GCODE_VARIABLE MACRO=_VAR_GLOBALS VARIABLE=temp_chamber VALUE={t_chamber} | |
NOTIFY TEXT={t_fl_extruder} | |
CLEAR_PAUSE | |
# Temperaturas de inicio de calentamiento | |
M104 S{t_fl_extruder} ; asigna la temperatura del extrusor | |
M140 S{t_fl_bed} ; asigna la temperatura de la cama | |
{% if t_chamber != 0 and printer["gcode_macro M141"] is defined %} | |
M141 S={t_chamber} ; asigna la temperatura de la cabina | |
{% endif %} | |
#G34 | |
#Move up to clean bed | |
{% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %} | |
{% set Z_MAX = printer.toolhead.axis_maximum.z|default(100)|float %} | |
G1 Y{Y_MAX - 20} Z{Z_MAX/4.0} F6000 | |
# Temperaturas objetivo | |
M190 S{t_fl_bed} ; espera hasta alcanzar la temperatura de la cama | |
M109 S{t_fl_extruder} ; espera hasta alcanzar la temperatura del extrusor | |
{% if t_chamber != 0 and printer["gcode_macro M191"] is defined %} | |
M191 S={t_chamber} ; espera hasta alcanzar la temperatura de cabina. | |
{% endif %} | |
# Calibrado de cama por zona de impresion inteligente | |
{% if printer.configfile.config["bltouch"] is defined or printer.configfile.config["probe"] is defined %} | |
{% if params.PRINT_MIN and params.PRINT_MAX and printer["gcode_macro BED_MESH_CALIBRATE"] is defined %} | |
NOTIFY TEXT=Calibrado de cama inteligente... | |
BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX} FORCE_NEW_MESH=1 # calibrado inteligente | |
BED_MESH_PROFILE LOAD=default # Load stored bed mesh | |
{% else %} | |
NOTIFY TEXT=Calibrado de cama normal... | |
G29 | |
BED_MESH_PROFILE LOAD=default # Load stored bed mesh | |
{% endif %} | |
{% endif %} | |
# Use absolute coordinates | |
G90 | |
# Move the nozzle near the be | |
G1 X0 Y0 Z5 F6000 | |
# Prime line | |
PRIME_LINE | |
{% else %} | |
NOTIFY TEXT='Uso: PRINT_START TEMP_EXTRUDER=<[TempI] | [Temp1C , TempI]> TEMP_BED=<[TempI] | [Temp1C , TempI]>\n Opcionales\n Temp Cabina TEMP_CHAMBER=[TempCab]\n mallado inteligente PRINT_MIN=[MINX,MINY] PRINT_MAX=[MAXX,MAXY]' | |
{% endif %} | |
[gcode_macro PRIME_LINE] | |
gcode: | |
#Get Printer built volume dimensions | |
{% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %} | |
{% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %} | |
{% set Z_MAX = printer.toolhead.axis_maximum.z|default(100)|float %} | |
#Get Nozzle diameter and filament width for conditioning | |
{% set NOZZLE = printer.extruder.nozzle_diameter|default(0.4)|float %} | |
{% set FILADIA = printer.extruder.filament_diameter|default(1.75)|float %} | |
#Set Start coordinates of priming lines | |
{% set X_START = 10.0|default(10.0)|float %} | |
{% set Y_START = 20.0|default(20.0)|float %} | |
#Calculate Primer line extrusion volume and filament length | |
{% set PRIMER_WIDTH = 0.75 * NOZZLE %} | |
{% set PRIMER_HEIGHT = 0.70 * NOZZLE %} | |
{% set PRIMER_SECT = PRIMER_WIDTH * PRIMER_HEIGHT %} | |
{% set PRIMER_VOL = PRIMER_SECT * (X_MAX - 3 * X_START) %} | |
{% set FILA_SECT = 3.1415 * ( FILADIA / 2.0)**2 %} | |
{% set FILA_LENGTH = 1.55 * PRIMER_VOL / FILA_SECT %} | |
#Precondition extruder | |
G92 E0 | |
G1 X{X_START} Y{Y_START} Z{PRIMER_HEIGHT} F6000.0 | |
G1 X{X_MAX - 2 * X_START} Y{Y_START} Z{PRIMER_HEIGHT} E{FILA_LENGTH} F2000.0 | |
G1 X{X_MAX - 2 * X_START} Y{Y_START + PRIMER_WIDTH} Z{PRIMER_HEIGHT} E{FILA_LENGTH} | |
G1 X{X_START} Y{Y_START + PRIMER_WIDTH} Z{PRIMER_HEIGHT} E{FILA_LENGTH} F2000.0 | |
G92 E0 | |
G1 Z2.0 F600 | |
G1 Z0.2 F600 | |
G1 Z2.0 F600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment