Error al programar una pausa por capa con el Cura versión 3.3
La aplicación Cura en su versión 3.3 me estaba dando problemas la programación de las pausas por capa. A seleccionar en el postprocesamiento el pause at height por layer no genera bien el código, ya que mueve el eje Z.
Ejemplo de código generado para una pausa en la capa 76:
;TIME_ELAPSED:16223.018787 ;TYPE:CUSTOM ;added code by post processing ;script: PauseAtHeight.py ;current layer: 15----Error---- M83 G1 F300 Z1----Error---- G1 F9000 X0 Y0 G1 F300 Z15----Error---- M84 E0 M104 S240; standby temperature M0;Do the actual pause M109 S240; resume temperature G1 F300 Z1 G1 F9000 X0.0 Y0.0 G1 F9000 M82 G92 E3010.34429
Para solucionarlo habría que hacerle unas modificaciones al script que se encarga de generar ese código. Ese script se encuentra en el directorio: C:\Program Files\Ultimaker Cura 3.3\plugins\PostProcessingPlugin\scripts
Tras cambiar el fichero, reiniciamos el cura y ya podemos ver que el códido que se genera ahora es correcto:
;TIME_ELAPSED:7785.277063 ;TYPE:CUSTOM ;added code by post processing ;script: PauseAtHeightorLayer.py ;current layer: 76 ;current z: 19.150000 ;pause_by: L ;current_temperature: 200 M83 G1 Z20.150000 F300 G1 X0.000000 Y0.000000 F9000 M84 E0 M104 S200 ; standby temperature M0 ; Do the actual pause M109 S200 ; resume temperature G1 Z20.150000 F300 G1 X101.937000 Y82.183000 F9000 G1 F9000 M82 G92 E3120.593920
Código corregido (abajo pongo la fuente donde lo encontré): PauseAtHeightorLayer.py
# PauseAtHeightorLayer script - Pause at a given height (in mm or layers) # Modified by Brad Morgan, brad-morgan@comcast.net ## Cloned from PauseAtHeight.py (Note: this can replace it by changing PauseAtHeightorLayer back to PauseAtHeight ## Added choice between height or layer to pause at (from TweakAtZ.py V5.1.1) ## Added some logging (most is commented out) ## Removed adjusting by layer 0 z so that a height in mm pauses closer to that height. ## Added current temperature search so that a pause without standby or resume temperatures might actually resume printing from ..Script import Script import re # from cura.Settings.ExtruderManager import ExtruderManager from UM.Logger import Logger class PauseAtHeightorLayer(Script): def __init__(self): super().__init__() def getSettingDataString(self): return """{ "name":"Pause at height or layer", "key": "PauseAtHeightorLayer", "metadata": {}, "version": 2, "settings": { "trigger": { "label": "Trigger", "description": "Trigger at height or at layer no.", "type": "enum", "options": {"height":"Height","layer_no":"Layer No."}, "default_value": "height" }, "pause_height": { "label": "Pause Height", "description": "At what height should the pause occur", "unit": "mm", "type": "float", "default_value": 5.0, "enabled": "trigger == 'height'" }, "pause_layer": { "label": "Pause Layer", "description": "At what layer should the pause occur", "unit": "", "type": "int", "default_value": 1, "enabled": "trigger == 'layer_no'" }, "head_park_x": { "label": "Park Print Head X", "description": "What X location does the head move to when pausing.", "unit": "mm", "type": "float", "default_value": 190 }, "head_park_y": { "label": "Park Print Head Y", "description": "What Y location does the head move to when pausing.", "unit": "mm", "type": "float", "default_value": 190 }, "retraction_amount": { "label": "Retraction", "description": "How much filament must be retracted at pause.", "unit": "mm", "type": "float", "default_value": 0 }, "retraction_speed": { "label": "Retraction Speed", "description": "How fast to retract the filament.", "unit": "mm/s", "type": "float", "default_value": 25 }, "extrude_amount": { "label": "Extrude Amount", "description": "How much filament should be extruded after pause. This is needed when doing a material change on Ultimaker2's to compensate for the retraction after the change. In that case 128+ is recommended.", "unit": "mm", "type": "float", "default_value": 0 }, "extrude_speed": { "label": "Extrude Speed", "description": "How fast to extrude the material after pause.", "unit": "mm/s", "type": "float", "default_value": 3.3333 }, "redo_layers": { "label": "Redo Layers", "description": "Redo a number of previous layers after a pause to increases adhesion.", "unit": "layers", "type": "int", "default_value": 0 }, "standby_temperature": { "label": "Standby Temperature", "description": "Change the temperature during the pause", "unit": "°C", "type": "int", "default_value": 0 }, "resume_temperature": { "label": "Resume Temperature", "description": "Change the temperature after the pause", "unit": "°C", "type": "int", "default_value": 0 } } }""" def execute(self, data: list): """data is a list. Each index contains a layer""" x = 0. y = 0. current_z = 0. pause_layer = -10000 pause_height = 10000.0 if self.getSettingValueByKey("trigger") == "layer_no": pause_layer = int(self.getSettingValueByKey("pause_layer")) pause_by = "L" else: pause_height = self.getSettingValueByKey("pause_height") pause_by = "H" # Logger.log("d", "pause_by = %s, pause_layer = %i, pause_height = %f", pause_by, pause_layer, pause_height) retraction_amount = self.getSettingValueByKey("retraction_amount") retraction_speed = self.getSettingValueByKey("retraction_speed") extrude_amount = self.getSettingValueByKey("extrude_amount") extrude_speed = self.getSettingValueByKey("extrude_speed") park_x = self.getSettingValueByKey("head_park_x") park_y = self.getSettingValueByKey("head_park_y") layers_started = False redo_layers = self.getSettingValueByKey("redo_layers") standby_temperature = self.getSettingValueByKey("standby_temperature") resume_temperature = self.getSettingValueByKey("resume_temperature") current_temperature = 0 # T = ExtruderManager.getInstance().getActiveExtruderStack().getProperty("material_print_temperature", "value") # with open("out.txt", "w") as f: # f.write(T) for layer in data: lines = layer.split("\n") for line in lines: if ";LAYER:0" in line: layers_started = True current_layer = 0 continue if self.getValue(line, 'M') == 104 or self.getValue(line, 'M') == 109: current_temperature = self.getValue(line, 'S') if current_temperature is None: current_temperature = self.getValue(line, 'R') if not layers_started: continue if ";LAYER:" in line: subPart = line[line.find(";LAYER:") + len(";LAYER:"):] m = re.search("^[+-]?[0-9]+\.?[0-9]*", subPart) current_layer = float(m.group(0)) if self.getValue(line, 'G') == 1 or self.getValue(line, 'G') == 0: current_z = self.getValue(line, 'Z') x = self.getValue(line, 'X', x) y = self.getValue(line, 'Y', y) if current_z is not None: # Logger.log("d", "Look for: pause_by = %s, pause_layer = %i, pause_height = %f, current_layer = %i, current_z = %f", pause_by, pause_layer, pause_height, current_layer, current_z) if (pause_by == "L" and current_layer == pause_layer) or (pause_by == "H" and current_z >= pause_height): # Logger.log("d", "Got one: pause_by = %s, pause_layer = %i, pause_height = %f, current_layer = %i, current_z = %f", pause_by, pause_layer, pause_height, current_layer, current_z) index = data.index(layer) prevLayer = data[index - 1] prevLines = prevLayer.split("\n") current_e = 0. for prevLine in reversed(prevLines): current_e = self.getValue(prevLine, 'E', -1) if current_e >= 0: break # include a number of previous layers for i in range(1, redo_layers + 1): prevLayer = data[index - i] layer = prevLayer + layer prepend_gcode = ";TYPE:CUSTOM\n" prepend_gcode += ";added code by post processing\n" prepend_gcode += ";script: PauseAtHeightorLayer.py\n" prepend_gcode += ";current layer: %i \n" % current_layer prepend_gcode += ";current z: %f \n" % current_z prepend_gcode += ";pause_by: %s \n" % pause_by if current_temperature is not None: prepend_gcode += ";current_temperature: %i \n" % current_temperature # Retraction prepend_gcode += "M83\n" if retraction_amount != 0: prepend_gcode += "G1 E-%f F%f\n" % (retraction_amount, retraction_speed * 60) # Move the head away prepend_gcode += "G1 Z%f F300\n" % (current_z + 1) prepend_gcode += "G1 X%f Y%f F9000\n" % (park_x, park_y) if current_z < 15: prepend_gcode += "G1 Z15 F300\n" # Disable the E steppers prepend_gcode += "M84 E0\n" # Set extruder standby temperature prepend_gcode += "M104 S%i ; standby temperature\n" % (standby_temperature) # Wait till the user continues printing prepend_gcode += "M0 ; Do the actual pause\n" # Set extruder resume temperature if resume_temperature != 0 or current_temperature is None: prepend_gcode += "M109 S%i ; resume temperature\n" % (resume_temperature) else: prepend_gcode += "M109 S%i ; resume previous temperature\n" % (current_temperature) # Push the filament back, if retraction_amount != 0: prepend_gcode += "G1 E%f F%f\n" % (retraction_amount, retraction_speed * 60) # Optionally extrude material if extrude_amount != 0: prepend_gcode += "G1 E%f F%f\n" % (extrude_amount, extrude_speed * 60) # and retract again, the properly primes the nozzle # when changing filament. if retraction_amount != 0: prepend_gcode += "G1 E-%f F%f\n" % (retraction_amount, retraction_speed * 60) # Move the head back prepend_gcode += "G1 Z%f F300\n" % (current_z + 1) prepend_gcode += "G1 X%f Y%f F9000\n" % (x, y) if retraction_amount != 0: prepend_gcode += "G1 E%f F%f\n" % (retraction_amount, retraction_speed * 60) prepend_gcode += "G1 F9000\n" prepend_gcode += "M82\n" # reset extrude value to pre pause value prepend_gcode += "G92 E%f\n" % (current_e) layer = prepend_gcode + layer # Override the data of this layer with the # modified data data[index] = layer return data break return data
Categorias
- adobe (2)
- agile (1)
- Alfresco (1)
- Android (26)
- Angular (6)
- angularjs (10)
- apache (1)
- axis (2)
- Bases de datos (14)
- Bootstrap (1)
- C# (3)
- Cámara (1)
- chrome (3)
- Codeigniter (2)
- Control de Versiones (2)
- CSS (25)
- CVS (1)
- Django (9)
- Django Rest Framework (1)
- DNS (1)
- Docker (3)
- dominio (1)
- eclipse (5)
- Entity Framework (2)
- ETL (1)
- Firefox (6)
- flash (1)
- freecad (1)
- Git (12)
- GitHub (4)
- gpg (2)
- Groovy (1)
- Handlebars (1)
- hibernate (4)
- hosting (1)
- HTML (50)
- HTML 5 (26)
- Impresión 3D (9)
- Inkscape (1)
- IOS (2)
- ireports (3)
- Java (44)
- Javascript (55)
- JBoss (5)
- JPA (2)
- JQuery (20)
- Json (7)
- JSP (6)
- Keycloak (1)
- Lamp (1)
- LDAP (2)
- lean (1)
- linkedin (1)
- LINQ (1)
- linux (13)
- Livecycle (1)
- log (1)
- microcontroladores (1)
- MongoDB (4)
- MySQL (8)
- Node.js (5)
- OC4J (1)
- Openshift (2)
- Oracle (6)
- Patrones de Diseño (1)
- Photoshop (2)
- php (20)
- PostgreSQL (1)
- python (19)
- rabbitmq (1)
- Raspberry PI (13)
- Raspherry PI (5)
- React (6)
- seguridad (3)
- Selenium (3)
- Sencha Touch (1)
- Sin categoría (29)
- Spring (17)
- spring-boot (3)
- SQL (7)
- SQLServer (1)
- SSO (1)
- struts (2)
- SVN (1)
- Talend (1)
- Tomcat (6)
- unity (3)
- Visual Studio Code (2)
- vmware (5)
- Web Services (11)
- windows (18)
- wordpress (10)
- Xiaomi (1)
- xml (2)
Trabajos Realizados
- App Android – Autoka Fr
- App Android – Cartelera Cántabra
- App Android – Gramática y Vocabulario Ingles
- App Android – Hoja de Gastos
- App Android – Hotel Torre Cristina
- App Android – OcioEnjoy
- App Android – Visor CardBoard
- App Firefox – Managapp
- DiamanteBomba – DisasterCode
- Generador de Partes de Trabajo
- GitHub – Android Web Generator
- GitHub – Dynamic Angular Gallery
- GitHub – Dynamic React Gallery
- GitHub – Sotilizator
- GitHub – SpringAngularJS
- GitHub – Swiper Dynamic Angular Gallery
- HazParejas – DisasterCode
- RompeCabezas – DisasterCode
- Unity Game – English Couple
- Unity Game – Kill Wasp
- WordPress – El Buen Apicultor
- WordPress – El Cajón de los Retales
- WordPress – El Vestidito Azul
- WordPress – Feuchas
- WordPress – Fragua de Navajas Ponce
- WordPress – Humor a las Tres
- WordPress – Photo Places