<p>Ok, I did it, I ordered myself an Ender-3, a genuine 24V e3D hotend, inductive sensor and some better tubing/clamps to cope with the problem the CR10/Ender line has occasionally.</p>

<p>But now I need to fix up my Cura for the machine coming in. The start is the CR10, and fixing the dimensions is easy.</p>

<p>But now comes the tricky part: Start and End G-code. For my TronXY I never bothered with changing it away from the "basic" settings that a "custom 3D printer" on Marlin gave, but this time I want to know what I type in there. The basic code, after I dragged out the G-code handbook from the RepRap wiki to add the missing comments is:</p>

<pre><code>G28            ;Home
G1 Z15.0 F6000 ;Move the Gantry up 15mm going fast
;Prime the extruder
G92 E0         ; reset extrusion distance
G1 F200 E3     ; extrude 3mm of feed stock
G92 E0         ; reset extrusion distance
</code></pre>

<p>The <a href="https://reprap.org/wiki/Start_GCode_routines" rel="noreferrer">RepRap Wiki</a> suggests that there could be made so much more from this. </p>

<p>I would love to <em>swipe</em> the nozzle before starting to print, making sure that the curled up filament from this first extrusion doesn't get squished against the nozzle and make a bad first layer.</p>

<p><strong>How does an example (commented) G-code for swiping the nozzle look like?</strong></p>

[{'answer_id': 6356, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 3, 'selected': False, 'text': '<h2>What code we have so far</h2>\n<p>The code already made by Ultimaker Cura 3 (and then commented on) can be explained a little more:</p>\n<p><code>G28 ;Home</code><br>\n<em>This homes your machine to hit end stop positions, from now on your printer knows the coordinates of the print volume. This place it knows as &lt;0-0-0&gt; - check where that is: above the print surface or next to it!<br></em>\n<code>G1 Z15.0 F6000 ;Move the Gantry up 15mm going fast</code><br>\n<em>Instruct the build plate to move down, or in your case lift the head up 15 mm at 6000 mm/min<br></em>\n<code>;Prime the extruder</code><br>\n<em>This is a comment that the nex code will deal with priming the nozzle<br></em>\n<code>G92 E0 ; reset extrusion distance</code><br>\n<em><a href="https://reprap.org/wiki/G-code#G92:_Set_Position" rel="nofollow noreferrer">G92</a> sets the position of the extruder by resetting the current position to the specified value of zero<br></em>\n<code>G1 F200 E3 ; extrude 3mm of feed stock</code><br>\n<em>This will extrude 3 mm of filament at a feedrate of 200 mm/min<br></em>\n<code>G92 E0 ; reset extrusion distance</code><br>\n<em>This will reset the extruder length again to zero<br></em></p>\n<h2>Result of the code</h2>\n<p>Basically you will have some filament dangling on your nozzle now, or falling of as the nozzle is hot creating a fine string. You now are facing the possibility that the primed material will be dragged along the build plate to the start of the print.</p>\n<h2>Nozzle Preparation: Priming sequences</h2>\n<h3>Ultimaker 3: \'blob\'&amp;swipe</h3>\n<p>An alternative I really like is the priming sequence of the Ultimaker 3. The hot end is instructed near the origin of the printer at about a height of 2 mm above the build plate when it starts to extrude plastic, once the extruded plastic becomes a puddle of about 6 mm in diameter the build plate lowers a few mm\'s and keep extruding for a bit. It then moves in positive Y direction (to the back) and raises the platform (this is the swipe action), then retracts and starts to move to the print start. Now the puddle of filament stays near the origin and will not be dragged.</p>\n<p>You can easily make a similar schematic for your printer, I\'ve done so also for various printers. Try and experiment what works best for you. The swipe action is the movement where the nozzle will be instructed to move near the build plate while moving in a certain direction (Y or X), a height of a few tenths is enough to swipe.</p>\n<p>I don\'t have my exact profile here, but you could add (skipping feedrates):</p>\n<pre><code>G1 Y15 Z0.2 ; moves the nozzle backwards and down from 15 mm to 0.2 mm\nG1 Y20 Z0.2 ; swipes the nozzle, this should cut off the &quot;worm&quot;\nG1 Z1     ; raise for movement to start of print to add a little space to travel\n</code></pre>\n'}, {'answer_id': 6357, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 4, 'selected': True, 'text': '<h2>The lazy way: Skirt/Brim</h2>\n<p>With my TronXY X1 I learned pretty fast, that this first bit of extrusion on an unheated bed can totally mess up the first layer by being just in the way, as explained in the question.</p>\n<p>To some degree, this behavior can be avoided by adding a skirt of a certain length. An equally good alternative that also increases bed adhesion for tricky parts is the brim. Both are not set via G-code but can be added by the slicer. In Ultimaker Cura both are found in the tab Build Plate Adhesion as type, as the following pictures show:</p>\n<h3>Skirt: 2 lines, minimum length 250mm</h3>\n<p><a href="https://i.stack.imgur.com/iN6IM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iN6IM.png" alt="Skirt: 2 lines, minimum length 250mm" /></a></p>\n<h3>Brim: minimum length 250mm, 8mm width</h3>\n<p><a href="https://i.stack.imgur.com/uL1Fn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uL1Fn.png" alt="Brim: minimum length 250mm, 8mm width" /></a></p>\n<h2>The Prusa Priming-line</h2>\n<p>Angus/MakersMuse introduced me to the Prusa Priming Line in one of his <a href="https://www.youtube.com/watch?v=6csbJ5965Bk" rel="nofollow noreferrer">tutorial videos</a>. For his Wanhao he used (for the video) just this start G-code script:</p>\n<pre><code>G28\nG1 Y-3 F500 ; Move out of print volume\nG1 X60 E9 F500 ; start purge line\nG1 X100 E12.5 F500 ; finish purge line\n</code></pre>\n<p>This resulted in a nice line like this:\n<a href="https://i.stack.imgur.com/GAWQW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GAWQW.png" alt="A printed &quot;Prusa Priming Line&quot;" /></a></p>\n<p>In Ultimaker Cura, this piece of code is added via the preferences of a machine. In Cura 3, you usually had to add the starting G-code yourself. Since at least version 4.2.1, all preset machines contain some variant of a priming line, usually at the left side.</p>\n'}, {'answer_id': 6406, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 2, 'selected': False, 'text': '<h2>Blob &amp; Cut</h2>\n<p>A different approach is to move to a position out off the print bed, then extrude a long piece of filament and then move forward, cutting the filament at the edge of the print surface. A sample G-code that needs to be adjusted to your bed:</p>\n<pre><code>G28\nG1 Y-5 X5 Z0.1 F500    ; Move off the print surface, a bit above the 0\nG92 E0                 ; reset extrusion distance\nG1 F200 E10            ; extrude 10mm of feed stock\nG92 E0                 ; reset extrusion distance\nG1 Y2 F500             ; Move into the print platform\n</code></pre>\n'}, {'answer_id': 7480, 'author': 'Benni Zwölfer', 'author_id': 13571, 'author_profile': 'https://3dprinting.stackexchange.com/users/13571', 'pm_score': 2, 'selected': False, 'text': "<p>This is my code:</p>\n\n<p>START CODE:</p>\n\n<pre><code>M117 Preparing....    ; Nozzle clean message\n\nM140 S{material_bed_temperature_layer_0}   ; set bed temp\n\nM107                  ; Turn layer fan off\nG21                   ; Metric\nG28                   ; Home X/Y/Z axis\nG0 X0 Y0 Z20 F9000    ; Move up 20mm for heating\n\nM104 S{material_print_temperature_layer_0} ; set extruder temp\nM190 S{material_bed_temperature_layer_0}   ; wait for bed temp\nM109 S{material_print_temperature_layer_0} ; wait for extruder temp\n\nG92 E0                ; Zero extruder\n\nG28                   ; Home X/Y/Z axis\nG0 X1 Z0.1 F9000      ; Move up 0.1mm\nG0 Y10 F500           ; Move 10mm to get rid of material\nG0 Z1 F9000           ; Move up\nG0 Y110 F9000         ; Move to line start\nG0 Z0.2 F9000         ; Move down\n\nG1 Y20 E25 F500       ; Extrude 25mm filament over 90mm Y axis\nG1 Y10 F500           ; Move 10mm without extracting\nG92 E0                ; Reset extruder\nG1 E-7 F1400          ; Retract 7mm filament\n\nM117 Printing....     ; Printing message\n</code></pre>\n\n<p>END CODE:</p>\n\n<pre><code>G91                   ; Incremental coordinates\nG1 E-3 F1800          ; Retract\nG1 Z10 F9000          ; Move up\nG90                   ; Absolute cooridinates\nM106 S0               ; Turn off cooling fan\nM104 S0               ; Turn off extruder\nM140 S0               ; Turn off bed\nG1 X0 Y220 F9000      ; Move back\nM84                   ; Disable motors\nM117 Finished!.       ; Printing message\n</code></pre>\n\n<p>It's almost working perfectly. I can start prints without checking if the first layer is good (requires a leveled bed).</p>\n\n<p>I am open for improvements</p>\n"}, {'answer_id': 10809, 'author': 'R.. GitHub STOP HELPING ICE', 'author_id': 11157, 'author_profile': 'https://3dprinting.stackexchange.com/users/11157', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve experimented a lot with priming/swiping in the G-code prologue, as a result of realizing from <a href="https://3dprinting.stackexchange.com/a/8643/11157">this question and answer</a> how important it is to get it right. The key points are:</p>\n\n<ul>\n<li>Don\'t go back and forth; you risk picking back up material you already got rid of. Just swipe in one direction.</li>\n<li>Don\'t overextrude. This can lead to ending with pressure remaining (especially for printers with bowden extruders) after the swipe/prime line is finished. It\'s fine if your extrusion rate is so low that adhesion doesn\'t start til halfway down the line.</li>\n<li>Slow movement with fan on is good.</li>\n</ul>\n\n<p>And with that said, here\'s what I use with my Ender 3:</p>\n\n<pre><code>M106 ; Max fan to discourage ooze sticking to nozzle\nG28 ; Home all axes\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F750.0 E18 ; Draw priming line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching\n</code></pre>\n\n<p>I also undo all but 1mm of the filament retraction at the end of my epilogue (custom end) G-code, to leave the printer in a state comparable to having freshly loaded filament. If you don\'t undo the retraction here, the low extrusion rate in the prologue might not be enough to prime the next time you print, but increasing it would over-prime in the case where you\'re dealing with freshly loaded filament.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/6355', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/8884/']