OllisGit / OctoPrint-PrintJobHistory

OctoPrint Plugin stores all print-job informations of a print in a database
139 stars 38 forks source link

Please use Spool data already provided by the slic3r, instead of other plugin #104

Open AndKe opened 3 years ago

AndKe commented 3 years ago

PrintJob history can display details found in the job, like: ; filament cost = 9.3 ; filament used = 40.5g

but it does not use them. There is not much point in maintaining filament collection/prices in more than one place. It is logical to have filaments in the slicer, or Slic3r - because that's where per-filamnet tuning like temperature and linear-extrusion coefficients are.

OllisGit commented 3 years ago

Hi @AndKe ,

it's a good idea...so the user should have a choice from which source the filament-data should be taken, right?

Please provide a sample file with a description which data you want to grab from the g-code. Maybe you have also an idea how I could design the plugin-settings for this feature.

BR Olli PS. Sorry, for being late to the party, but I made a "Octoprint sabatical" (no coding, no printing) the last months.

AndKe commented 3 years ago

I would suggest to have a simple checkbox in the settings: "use slicer-provided data when available" please see the great goodies you'll get right in the .gcode: (I am adding ########## to what I consider most useful) Unfortunatly the material type/color us not in the comments, but that can be fixed... The most important things and cost/weight are there already.

; generated by Slic3r 1.3.1-dev (Build 54a31ee) on 2021-01-04 at 20:53:09  ##########
; 
; external perimeters extrusion width = 0.44mm (1.59mm^3/s)
; perimeters extrusion width = 0.56mm (4.14mm^3/s)
; infill extrusion width = 0.50mm (5.48mm^3/s)
; solid infill extrusion width = 0.56mm (2.07mm^3/s)
; top infill extrusion width = 0.56mm (1.55mm^3/s)

G92 E0
M190 S77 ; set bed temperature and wait for it to be reached
M104 S260 ; set temperature
M851 Z-1.50  ;Z Probe Offset in firmware =0   // negative means more squished  
;M85 S720 ; kill job if no activity for 12min
G28 ; home all axes
;G29 ;level bed
G1 X300 F8000 ;park at end of X axis , present print , feedrate
G1 X318 F700 ;park X axis , feedrate
; M85 S300 ; kill job if no activity for 5min
; process 0
; Filament gcode

M109 S260 ; set temperature and wait for it to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
G92 E0
G1 Z0.350 F9000.000
G1 E-4.00000 F3600.00000
G92 E0
G1 X121.537 Y72.891 F9000.000
G1 E4.00000 F3600.00000
G1 F1800.000
G1 X122.671 Y71.109 E4.19203
G1 X124.382 Y69.871 E4.38406
G1 X126.766 Y69.341 E4.60616
G1 X182.795 Y69.341 E9.70082

...
...
...

G1 X127.321 Y88.125 E4.00190
G1 X127.321 Y94.022 E4.10942
G1 X127.346 Y94.123 E4.11132
G1 X127.321 Y94.225 E4.11322
G1 X127.321 Y100.122 E4
G92 E0
; Filament-specific end gcode 
;END gcode for filament

; process ENDGCODE
M104 S0 ; turn off extruder heat
M140 S0 ;bed heating off
G1 X300 F8000 ;park at end of X axis , present print , feedrate
G1 X318 F700 ;park X axis , feedrate
G1 Y300 ; present print 
M84  ; disable motors
; M85 S0;  disable kill

; filament used = 5328.4mm (12.8cm3)  ##########
; filament used = 13.3g    ##########
; filament cost = 2.7      ##########
; total filament cost = 2.7     ##########

; avoid_crossing_perimeters = 0
; bed_shape = 0x0,300x0,300x300,0x300
; bed_temperature = 77      ##########
; before_layer_gcode = 
; between_objects_gcode = ; process [current_object_idx]
; bridge_acceleration = 0
; bridge_fan_speed = 0
; brim_connections_width = 0
; brim_ears = 0
; brim_ears_max_angle = 125
; brim_width = 3
; complete_objects = 0
; cooling = 0
; default_acceleration = 0
; disable_fan_first_layers = 7
; duplicate_distance = 6
; end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n"
; end_gcode = ; process ENDGCODE\nM104 S0 ; turn off extruder heat\nM140 S0 ;bed heating off\nG1 X300 F8000 ;park at end of X axis , present print , feedrate\nG1 X318 F700 ;park X axis , feedrate\nG1 Y300 ; present print \nM84  ; disable motors\n; M85 S0;  disable kill\n
; extruder_clearance_height = 60
; extruder_clearance_radius = 1
; extruder_offset = 0x0
; extrusion_axis = E
; extrusion_multiplier = 1
; fan_always_on = 0
; fan_below_layer_time = 5
; fan_percentage = 0
; filament_colour = #FD5A03
; filament_cost = 200
; filament_density = 1.04
; filament_diameter = 1.75
; filament_max_volumetric_speed = 0
; filament_notes = "Kapton+ABS juice : good adhesion with raft  at 93deg\nUltraBase: some warping at 110deg \nBuildTec: VERY good bed adhesion at 85°C   , 70°C\n\n250°C extrusion  good layer adhesion, 238 is too low."
; first_layer_acceleration = 0
; first_layer_bed_temperature = 77     ##########
; first_layer_extrusion_width = 200%
; first_layer_speed = 30
; first_layer_temperature = 260     ##########
; gcode_arcs = 0
; gcode_comments = 0
; gcode_flavor = reprap
; has_heatbed = 1
; infill_acceleration = 0
; infill_first = 0
; interior_brim_width = 0
; label_printed_objects = 0
; layer_gcode = 
; max_fan_speed = 50
; max_layer_height = 0.3 
; max_print_speed = 80
; max_volumetric_speed = 0
; min_fan_speed = 0
; min_layer_height = 0.1
; min_print_speed = 10
; min_skirt_length = 25
; notes = reduced infill speed from 80 to 60 as a test
; nozzle_diameter = 0.4
; only_retract_when_crossing_perimeters = 1
; ooze_prevention = 0
; output_filename_format = [input_filename_base].gcode
; perimeter_acceleration = 0
; post_process = 
; pressure_advance = 0
; printer_notes = 4mm retraction is fine. \n5mm jammed with white PLA  -\n\nE0 is a bit too strong\n\nLinear Advance: http://marlinfw.org/tools/lin_advance/k-factor.html\nM900 K0.6 ;  ok for PLA at 210°C\nM900  K4 ; ok for TPU , calibration shows that  a value of 2-2.4 is good, should be tested\n\nBuildTak \n\n1. PLA:50-70℃\n2. Flexible filament: 50-70℃\n3. ABS:100-125℃ ( 110℃ is recommended )\n4. PC:100-130℃ ( 120℃ is recommended )\n5. Nylon:90-120℃ ( 110℃ is recommended )\n6. PP:100-130℃ ( 120℃ is recommended )\n7. PETG: 50-70℃\n\nABS 80° , @250° - still warping\n\n\nAnyCubic Ultrabase: (Glass)\nPLA: 50°C is good.\nTPU : 40°C is good.\n\nCCTREE magnetic Surface;\nABS 80° , @250° - still warping\nPLA: 50  seems plenty\nTPU : 70 is too sticky \n\nPEI-double-sided steel, no-name;\nABS: POOR adhesion at 80° +250°\nPLA: POOR  adhesion at 55-65°C\nTPU: decent adhesion already at 40°C\n
; resolution = 0
; retract_before_travel = 2
; retract_layer_change = 0
; retract_length = 4
; retract_length_toolchange = 10
; retract_lift = 0
; retract_lift_above = 0
; retract_lift_below = 0
; retract_restart_extra = 0
; retract_restart_extra_toolchange = 0
; retract_speed = 60
; skirt_distance = 5
; skirt_height = 1
; skirts = 1
; slowdown_below_layer_time = 5
; spiral_vase = 0
; standby_temperature_delta = -5
; start_filament_gcode = "; Filament gcode\n"
; start_gcode = M851 Z-1.50  ;Z Probe Offset in firmware =0   // negative means more squished  \n;M85 S720 ; kill job if no activity for 12min\nG28 ; home all axes\n;G29 ;level bed\nG1 X300 F8000 ;park at end of X axis , present print , feedrate\nG1 X318 F700 ;park X axis , feedrate\n; M85 S300 ; kill job if no activity for 5min\n; process 0
; temperature = 250
; threads = 8
; toolchange_gcode = 
; travel_speed = 150
; use_firmware_retraction = 0
; use_relative_e_distances = 0
; use_set_and_wait_bed = 0
; use_set_and_wait_extruder = 0
; use_volumetric_e = 0
; vibration_limit = 0
; wipe = 0
; z_offset = 0
; z_steps_per_mm = 0
; adaptive_slicing = 0
; adaptive_slicing_quality = 75%
; dont_support_bridges = 0
; extrusion_width = 0
; first_layer_height = 0.35
; infill_only_where_needed = 0
; interface_shells = 0
; layer_height = 0.2
; match_horizontal_surfaces = 0
; raft_layers = 0
; regions_overlap = 0
; seam_position = aligned
; sequential_print_priority = 0
; support_material = 0
; support_material_angle = 0
; support_material_buildplate_only = 0
; support_material_contact_distance = 0.2
; support_material_enforce_layers = 0
; support_material_extruder = 1
; support_material_extrusion_width = 0
; support_material_interface_extruder = 1
; support_material_interface_extrusion_width = 0
; support_material_interface_layers = 3
; support_material_interface_spacing = 0
; support_material_interface_speed = 100%
; support_material_max_layers = 0
; support_material_pattern = pillars
; support_material_pillar_size = 2.5
; support_material_pillar_spacing = 10
; support_material_spacing = 2.5
; support_material_speed = 60
; support_material_threshold = 30%
; xy_size_compensation = 0
; bottom_infill_pattern = rectilinear
; bottom_solid_layers = 2
; bridge_flow_ratio = 1
; bridge_speed = 60
; external_perimeter_extrusion_width = 0
; external_perimeter_speed = 50%
; external_perimeters_first = 0
; extra_perimeters = 1
; fill_angle = 45
; fill_density = 40%
; fill_gaps = 1
; fill_pattern = honeycomb
; gap_fill_speed = 20
; infill_every_layers = 1
; infill_extruder = 1
; infill_extrusion_width = 0
; infill_overlap = 55%
; infill_speed = 60
; min_shell_thickness = 0
; min_top_bottom_shell_thickness = 0
; overhangs = 1
; perimeter_extruder = 1
; perimeter_extrusion_width = 0
; perimeter_speed = 40
; perimeters = 3
; small_perimeter_speed = 15
; solid_infill_below_area = 70
; solid_infill_every_layers = 0
; solid_infill_extruder = 1
; solid_infill_extrusion_width = 0
; solid_infill_speed = 20
; thin_walls = 1
; top_infill_extrusion_width = 0
; top_infill_pattern = rectilinear
; top_solid_infill_speed = 15
; top_solid_layers = 2
AndKe commented 3 years ago

PrusaSlicer (based on Slic3r - and in active development) has also

; filament_colour = #29B2B2     ################## HERE IS THE COLOR
; filament_cooling_final_speed = 3.4
; filament_cooling_initial_speed = 2.2
; filament_cooling_moves = 4
; filament_cost = 0
; filament_density = 0
; filament_diameter = 1.75
; filament_load_time = 0
; filament_loading_speed = 28
; filament_loading_speed_start = 3
; filament_max_volumetric_speed = 0
; filament_minimal_purge_on_wipe_tower = 15
; filament_notes = ""      ################  HERE could the manufacturer be...
; filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
; filament_settings_id = PLA with a name  ################## HERE IS THE NAME
OllisGit commented 3 years ago

Added some implementation notes for myself:

@AndKe do you have a sample which use multi-extruders? Is there an added number behind the keys, like filament_diameter3?

AndKe commented 3 years ago

@OllisGit A quick test shows me that repeating output is for next item: This is output from a two-extruder job:

; filament used = 761.8mm (1.8cm3) ; filament used = 2.2g ; filament cost = 0.5 ; filament used = 73.9mm (0.2cm3) ; filament used = 0.2g ; filament cost = 0.0 ; total filament cost = 0.6

LRTNZ commented 2 years ago

Just curious as to where this is at?

OllisGit commented 2 years ago

fyi: I am starting writing a kind of concept to implement such feature. I am looking for a simple and easy to use solution. https://github.com/OllisGit/OctoPrint-PrintJobHistory/wiki/GCodeSpoolInfo