slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.31k stars 1.29k forks source link

wrong Lift Z before tool change #1338

Closed danfitz7 closed 11 years ago

danfitz7 commented 11 years ago

Using: Slic3r 0.9.10b precompiled package for Windows 64bit OS: Windows 7 64bit

ACTUAL: In situations with multiple tools with different lift_z distances, when changing tools and traveling to another object within a layer, the first tool retracts according to its 'retract_length_toolchange', then "lift plate during travel" according to it's 'lift_z', then a tool change occurs to the second tool, which retracts according to its 'retract_length', moves to the first perimeter point of the new object, and "restores layer Z" by subtracting its 'lift_z' from its current travel height. However, if the lift_z distances for each tool are different, the new tool's height will now be offset from the correct height by the difference between their respective 'lift_z' values. If the second tool has a 'lift_z' greater than that of the first tool, this can potentially crash the tool by sending it to a negative z coordinate when it attempts to "restore layer Z".

EXPECTED: In these situations, the first tool should retract according to its 'retract_length_toolchange', then a tool change should occur to the second tool, which should then "lift plate during travel" according to its 'lift_z', travel to the first perimeter point of the new object, "restore layer z" by subtracting its 'lift_z', then "compensate retraction" according to its 'retract_length_toolchange', and start the new perimeter.

As seen in Repetier host G code visualizer (relivant code selected): slic3rbug

SLIC3R CONFIGURATION:

generated by Slic3r 0.9.10b on Fri Jul 19 16:41:10 2013

avoid_crossing_perimeters = 1 bed_size = 76.2,50.8 bed_temperature = 0 bottom_solid_layers = 2 bridge_acceleration = 0 bridge_fan_speed = 100 bridge_flow_ratio = 1.5 bridge_speed = 20 brim_width = 4 complete_objects = 0 cooling = 1 default_acceleration = 0 disable_fan_first_layers = 1 duplicate = 1 duplicate_distance = 6 duplicate_grid = 1,1 end_gcode = external_perimeter_speed = 100% external_perimeters_first = 1 extra_perimeters = 1 extruder_clearance_height = 20 extruder_clearance_radius = 20 extruder_offset = 77.7198x11.542222635,0x0 extrusion_axis = E extrusion_multiplier = 1,1,1 extrusion_width = 0 fan_always_on = 0 fan_below_layer_time = 60 filament_diameter = 3,3,3 fill_angle = 45 fill_density = 1 fill_pattern = rectilinear first_layer_bed_temperature = 0 first_layer_extrusion_width = 0 first_layer_height = 100% first_layer_speed = 50% first_layer_temperature = 200,200,200 g0 = 0 gap_fill_speed = 20 gcode_arcs = 0 gcode_comments = 1 gcode_flavor = reprap infill_acceleration = 0 infill_every_layers = 1 infill_extruder = 1 infill_extrusion_width = 0 infill_first = infill_only_where_needed = 0 infill_speed = 20 layer_gcode = layer_height = .2 max_fan_speed = 100 min_fan_speed = 35 min_print_speed = 10 min_skirt_length = 0 notes = nozzle_diameter = .35,.2 only_retract_when_crossing_perimeters = output_filename_format = [input_filename_base] perimeter_acceleration = 0 perimeter_extruder = 1 perimeter_extrusion_width = 0 perimeter_speed = 20 perimeters = 2 post_process = print_center = 38.1,25.4 raft_layers = 0 randomize_start = resolution = 0 retract_before_travel = 1,.79 retract_layer_change = 1,1 retract_length = 3,5 retract_length_toolchange = 1,1 retract_lift = 7,11 retract_restart_extra = 0,0 retract_restart_extra_toolchange = 0,0 retract_speed = 40,1 rotate = 0 scale = 1 skirt_distance = 6 skirt_height = 1 skirts = 2 slowdown_below_layer_time = 30 small_perimeter_speed = 20 solid_fill_pattern = rectilinear solid_infill_below_area = 0.1 solid_infill_every_layers = 0 solid_infill_extrusion_width = 0 solid_infill_speed = 20 spiral_vase = 0 start_gcode = support_material = 0 support_material_angle = 0 support_material_enforce_layers = 0 support_material_extruder = 1 support_material_extrusion_width = 0 support_material_interface_layers = 0 support_material_interface_spacing = 0 support_material_pattern = rectilinear support_material_spacing = 2.5 support_material_speed = 20 support_material_threshold = 0 temperature = 200,200,200 threads = 16 toolchange_gcode = top_infill_extrusion_width = 0 top_solid_infill_speed = 20 top_solid_layers = 2 travel_speed = 500 use_relative_e_distances = vibration_limit = 0 wipe = 0,0 z_offset = 0

alranel commented 11 years ago

First off, thank you for the very good bug report. I love it when all the details are in, and nicely explained.

While I agree with you about the expected behavior, I do wonder about much does it make sense to have different lift Z settings for each extruder. The only reason for that setting to be in the Extruder section (and thus, repeated for each extruder) is that we can have it closer to other retraction settings in the GUI. Other than that, I really think that it should be set only once per printer (or per print? but still not for each extruder). Could you imagine a good case where distinct values make sense?

danfitz7 commented 11 years ago

Thanks! I tried to investigate far enough so that I knew what might be going on and why it would be happening, and to convey that in the report. I tried to include the .amf file as well, but GHF Markdown didn't seem to like all the tag marks. Is there a good way to post that kind of code?

I actually found this bug (and several others which I'll try to report later), while adapting Slic3r to control a type CNC stage which I've converted to a 3D printer. I've been writing post processing scripts to delete, change, and insert G Codes to try to control systems other than desktop FDM style, such as larger custom stages that use different types of materials and extrusion methods.

From that perspective, I actually think the opposite: it would be incredibly useful if all or most of the parameters in Slic3r could be specified on a per-material (per-tool/per-extruder) basis. I would love to be able to not only save and export configuration settings for a specific printer, but also for a specific material/extruder. True, this is usually not needed for standard thermoplastic printers used for rapid prototyping or artistic/hobby models, where one filament of ABS or PLA behaves similarly to any other and they are all being used to build the same types of structures. However, I've been experimenting with printing different parts of objects with different types of materials to do different things (not just support material vs. structural material, but soft material vs. hard material, transparent vs. opaque, etc.), and I expect many other people will inevitably try to do similar things. For that kind of application, it would be highly desirable to have more generalized software to put the right material in the right place in the right way - different parts of objects printed at different temperatures, with different feed rates, extrusion multipliers, infills, different lifting and retraction behaviors, etc. For example, what if someone tried to mount an additional fab@home style nozzle on their reprap? They wouldn't want to print, say, silicone caulking or a UV-cured resin with the same settings as 3mm ABS filament. Why would anyone want to use multiple materials that are so different on the same print? Well....that's the fun part ;)

danfitz7 commented 11 years ago

I changed the file extension on the .amf to .jpg so it would let me upload:

layeredbrickscurvy

alranel commented 11 years ago

I agree with the need for having multiple per-extruder settings. That's something I've been working on for months, and all of the Slic3r internals are ready. Now I need to do some GUI work to expose this ability.

However, lift is a bit different because when you lift the carriage all of the extruders are raised - at list in all of the known machines. So the semantics of a per-extruder lift are quite ambiguous. Such thing would require more design work before being implemented.