slic3r / Slic3r

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

[Feature Request] Set initial Z height after moving to print XY coordinates #964

Closed Itchetiky closed 11 years ago

Itchetiky commented 11 years ago

I like to have the Z moved to a raised position prior to moving to the starting XY coordinates, and I do this in start.gcode. The trick comes when the generated gcode moves the head to the initial starting location. The trick I do is, using Repetier, I edit the gcode to move the first G1 Zxx move to occur after the first G1 Xxxx Yxxx.

Examples.

Before

M190 S115 ; wait for bed temperature to be reached
M104 S230 ; set temperature
M92 E745.000000
G28 ; home all axes
G1 Z10 F7800.000
M106 S127
M109 S230 ; wait for temperature to be reached
G90 ; use absolute coordinates
G21 ; set units to millimeters
G92 E0
M82 ; use absolute distances for extrusion
M106 S127
G1 F3600.000 E-2.50000
G92 E0
G1 Z0.307 F7800.000
G1 X123.550 Y75.340
G1 F3600.000 E2.50000
G1 X122.760 Y86.750 F2160.000 E2.81813

After

M106 S126 ; Manually Added as start.gcode is added after the temps are set
M190 S115 ; wait for bed temperature to be reached
M104 S230 ; set temperature
M92 E745.000000
G28 ; home all axes
G1 Z10 F7800.000
M106 S127
M109 S230 ; wait for temperature to be reached
G90 ; use absolute coordinates
G21 ; set units to millimeters
G92 E0
M82 ; use absolute distances for extrusion
M106 S127
;G1 F3600.000 E-2.50000 ; I prefer not to have my filament retracted
G92 E0
;G1 Z0.307 F7800.000 ; Slic3r places G1 Zxxx movement
G1 X123.550 Y75.340
G1 Z0.307 F7800.000 ; My placed G1 Zxxx movement
G1 F3600.000 E2.50000
G1 X122.760 Y86.750 F2160.000 E2.81813
alranel commented 11 years ago

You say "I like to have the Z moved to a raised position prior to moving to the starting XY coordinates" but you're showing the opposite. I don't understand...

Itchetiky commented 11 years ago

My apologies. In the "before" example the line G1 Z10 F7800.000 comes from start.gocde where I have added it in order to raise the Z height, and I've also included to much extraneous code so I probably inadvertently obfuscated the issue.

Since Slic3r is generating a G28, all axis are set to 0,0,0. So in my case Z0 is about .05mm above the print bed. The first move Slic3r causes is a move to set the Z height, Z0.307 the initial layer height, then it moves to the location X123.550, Y75.340, start starting XY coordinates).

I'd like it see Slic3r change the order the gcode it generates for this first move, from this (Z first then XY) -

G1 Z0.307 F7800.000
G1 X123.550 Y75.340

To this (XY first then Z)-

G1 X123.550 Y75.340
G1 Z0.307 F7800.000
alranel commented 11 years ago

That still doesn't match your statement: "I like to have the Z moved to a raised position prior to moving to the starting XY coordinates" so I am still a bit confused. Anyway, I don't usually do things just because someone "would like" them. Do you mind to provide a reason for such request? :-)

kefir- commented 11 years ago

I disagree on this one. I don't know @itchetiky's reasons for wanting this yet, but my reason for not wanting this is that when moving this low, the nozzle may bump into an uneven bed.

As an alternative, I'd be happy for slic3r to generate this code the same way as Skeinforge, just moving all three axes in one sweep:

G1 X123.550 Y75.340 Z0.307 Fwhatever

and run this at the normal X/Y speed, unless that would move Z too fast, in which case the speed should be limited so Z moves at its maximum speed. Requires some trigonometry to work out the details, I guess.

Itchetiky commented 11 years ago

Yes, what @kefir said.

The reason for the request is that the hot end nozzle may snag or drag the surface of the heat bed. If the surface is coated with blue painters tape, kapton tape, ABS juice, PVA juice, or not perfectly level, either the nozzle itself or a build up of filament is drug across the print surface.

I don't know how to explain my comment of - "I like to have the Z moved to a raised position prior to moving to the starting XY coordinates." I like to have the Z moved to a raised position [of 10mm above the print surface] prior to moving to the starting XY coordinates. Once the move to the XY coordinate, lower Z to initial layer height.

What I hoped to convey was have Slic3r not move Z first. Don't move Z first, move X and Y first then move Z.

Slic3r performs the first move in this order Step 1) G1 Z Step 2) G1 X Y

I'm proposing the movement happens in this order Step 1) G1 X Y Step 2) G1 Z

Slic3r is genius piece of software. The fact it does what it does just amazes me.

Thank you for your, and your teams, hard work.

alranel commented 11 years ago

Okay, now I got it.

The purpose of this looks like a duplicate or #763 but unfortunately such change would cause major issues for thousands of users, with nozzle tip moving horizontally at Z = 0 and that's no good.

The usual workarounds for bumpy and uneven beds are setting first layer height to the same value as your nozzle diameter (i.e. the maximum layer height you can achieve with your machine). This will move the nozzle tip with a good clearance.

You might also want to move to the center in your start G-code:

G1 Z10
G1 X[print_center_X] Y[print_center_Y]