1 (edited by lawsy 2012-10-27 21:03:36)

Topic: Improved start and end G-code

I've not been happy with the default start and end g-code, so have been developing a better version based on the versions Ian posted on his blog.

I'm not sure about others, but I was particularly sick of the nozzle scraping across the platform in the back right corner as it left the home position to start printing. I was also sick of the first extrusions not working as plastic had oozed out of the hot tip.

My g-code rectifies both of these problems.

For Slic3r
Slic3r will let you use variables in your start and end g-code, which I have done. This g-code works best if you set the first layer extruder temp to 0 in Slic3r. Don't worry, it will still be heated appropriately for the first layer using this code.

Start:

G21; set mm units
G28 ;home all axis
M190 S[first_layer_bed_temperature] ; set and wait for bed temp to be reached
M104 S[temperature] ; set extruder temp and start heating
G90; set absolute coordinates
G1 Z5 F300 ;move platform down 5mm
G1 X10 Y10 F3000 ;move to front left corner
M109 S[temperature]; wait for extruder temp to be reached
G1 Z[first_layer_height] F200 ;move platform close to nozzle
G92 E0; reset extrusion distance
G1 E7 ;extrude anchor

EDIT:
Repetier-Host 0.74 kills the above code due to support for multiple extruders. Instead of [temperature] in those two lines, subtitute in your actual temp number you are seeking. EG:

M104 S200 ; set extruder temp and start heating

End:

G28 X0 Y0  ; home X axis and y axis
G1 Z150 F300 ; lower platform to bottom
M104 S0 ; kill extruder temperature
M140 S0 ; kill bed temperature
M84 ; disable motors

For Skeinforge
Manual values must be substituted whereever Slic3r variables were inside [square brackets].

Example:

G1 Z[first_layer_height] F200 ;move platform close to nozzle

becomes

G1 Z0.25 F200 ;move platform close to nozzle

or whatever your layer height is set to.

Here is a video of the new g-code in action:

2

Re: Improved start and end G-code

What is extrude anchor?

I had been considering changing mine so that it would wait at home to heat, so that any ooze would be over air rather than the platform.

3

Re: Improved start and end G-code

It squirts a big blob of plastic into the bed in the corner. This clears any burnt plastic in the extruder, replaces any plastic in the extruder that has oozed out, and any bits of plastic on the tip tend to get stuck in the blob, clearing the nozzle.

It's beautifully illustrated in the video but my upload is having trouble.

4

Re: Improved start and end G-code

lawsy wrote:

It squirts a big blob of plastic into the bed in the corner. This clears any burnt plastic in the extruder, replaces any plastic in the extruder that has oozed out, and any bits of plastic on the tip tend to get stuck in the blob, clearing the nozzle.

It's beautifully illustrated in the video but my upload is having trouble.

That is the way to go, you typically see this on professional printers. One thing you might want to add is have it rub against a brush before it starts printing.

5

Re: Improved start and end G-code

Ok the video is finally up. It contains a full demonstration,

6

Re: Improved start and end G-code

does using your start gcode negate the need for a skirt around the part using slic3r? Should I just turn that feature off if im using your gcode?

thanks

7

Re: Improved start and end G-code

If you were using the skirt as a way to make sure the extruder was primed before starting the first part, then yes.

Personally I like to leave it on just to make sure the print is starting where I think it's going to start.

8

Re: Improved start and end G-code

Thanks for this, fixed my crash into y, not sure why my start.gcode was incorrect.
added a X-65 and Y-65 to bed offset, i can centre with replicatorg and import no and it prints bed centre, displays incorrectly on pronterface screen though down bottom left corner.

changed the bed warmup a little, waits till 95 then starts the extruder heat while continuing to heat till 100.
changed the end.gcode so it only drops bed back to 70.


start.gcode

G21; set mm units
G28 ;home all axis
M190 S95 ; set and wait for bed temp of 95 to be reached
M140 S100     ;then set bed to 100
M104 S200 ; set extruder temp and start heating
G90; set absolute coordinates
G1 Z5 F300 ;move platform down 5mm
G1 X10 Y10 F3000 ;move to front left corner
M109 S200; wait for extruder temp to be reached
G1 Z0.25 F200 ;move platform close to nozzle
G92 X-65 Y-65 E0; reset extrusion distance and chnage bed offset for replicatorg
G1 E7 ;extrude anchor blob

 

end.gcode

G28 X0 Y0  ; home X axis and y axis
G1 Z150 F300 ; lower platform to bottom
M104 S0 ; kill extruder temperature
M140 S70 ; DROP BED TEMPERATURE
M84 ; disable motors

9

Re: Improved start and end G-code

Stoney wrote:

Thanks for this, fixed my crash into y, not sure why my start.gcode was incorrect.
added a X-65 and Y-65 to bed offset, i can centre with replicatorg and import no and it prints bed centre, displays incorrectly on pronterface screen though down bottom left corner.

changed the bed warmup a little, waits till 95 then starts the extruder heat while continuing to heat till 100.
changed the end.gcode so it only drops bed back to 70.


start.gcode

G21; set mm units
G28 ;home all axis
M190 S95 ; set and wait for bed temp of 95 to be reached
M140 S100     ;then set bed to 100
M104 S200 ; set extruder temp and start heating
G90; set absolute coordinates
G1 Z5 F300 ;move platform down 5mm
G1 X10 Y10 F3000 ;move to front left corner
M109 S200; wait for extruder temp to be reached
G1 Z0.25 F200 ;move platform close to nozzle
G92 X-65 Y-65 E0; reset extrusion distance and chnage bed offset for replicatorg
G1 E7 ;extrude anchor blob

 

end.gcode

G28 X0 Y0  ; home X axis and y axis
G1 Z150 F300 ; lower platform to bottom
M104 S0 ; kill extruder temperature
M140 S70 ; DROP BED TEMPERATURE
M84 ; disable motors

When did you download the software? Start.gcode should work out of the box.

Former Solidoodle employee, no longer associated with the company.

10

Re: Improved start and end G-code

smile good point, probably a few months ago now.
I downloaded the software a while back to have a play and I probably should have deleted the lot and grabbed the latest.

11

Re: Improved start and end G-code

Stoney wrote:

smile good point, probably a few months ago now.
I downloaded the software a while back to have a play and I probably should have deleted the lot and grabbed the latest.

Ah! Good to hear. Was worried we had something out of whack once again.

Former Solidoodle employee, no longer associated with the company.

12

Re: Improved start and end G-code

If im not using the updated firmware on my solidoodle,

would this work as the start code:

G21
G91
M190 S100 ; set and wait for bed temp to be reached
G1 X200 F3000
G1 Y200 F3000
G1 X-82 Y-76 F3000
G1 Z-200 F500
G1 Z5 F500
G1 Z-10 F250
M104 S180 ; set extruder temp and start heating
G90
G1 X10 Y10 F3000 ;move to front left corner
G1 E7 ;extrude anchor
G92 X0 Y0 Z0 E0

End Code:

G91
G1 Z30 F1000
M104 S0 ; kill extruder temperature
M140 S70 ; DROP BED TEMPERATURE
M84

13

Re: Improved start and end G-code

I have tried this start and end code. When I start the print, it homes and starts the heater but not the bed. I see in the console that the temp starts to rise on the heater but where the bed temp should be, it appears to be an error. From the console:

T:35.5 E:0 W:?

The bed temp does not rise. I can manually set it form the interface.

How do I correct the bed not starting to heat up?

14

Re: Improved start and end G-code

lawsy wrote:

I've not been happy with the default start and end g-code, so have been developing a better version based on the versions Ian posted on his blog.

I'm not sure about others, but I was particularly sick of the nozzle scraping across the platform in the back right corner as it left the home position to start printing. I was also sick of the first extrusions not working as plastic had oozed out of the hot tip.

My g-code rectifies both of these problems.

For Slic3r
Slic3r will let you use variables in your start and end g-code, which I have done. This g-code works best if you set the first layer extruder temp to 0 in Slic3r. Don't worry, it will still be heated appropriately for the first layer using this code.

Start:

G21; set mm units
G28 ;home all axis
M190 S[first_layer_bed_temperature] ; set and wait for bed temp to be reached
M104 S[temperature] ; set extruder temp and start heating
G90; set absolute coordinates
G1 Z5 F300 ;move platform down 5mm
G1 X10 Y10 F3000 ;move to front left corner
M109 S[temperature]; wait for extruder temp to be reached
G1 Z[first_layer_height] F200 ;move platform close to nozzle
G92 E0; reset extrusion distance
G1 E7 ;extrude anchor

EDIT:
Repetier-Host 0.74 kills the above code due to support for multiple extruders. Instead of [temperature] in those two lines, subtitute in your actual temp number you are seeking. EG:

M104 S200 ; set extruder temp and start heating

End:

G28 X0 Y0  ; home X axis and y axis
G1 Z150 F300 ; lower platform to bottom
M104 S0 ; kill extruder temperature
M140 S0 ; kill bed temperature
M84 ; disable motors

For Skeinforge
Manual values must be substituted whereever Slic3r variables were inside [square brackets].

Example:

G1 Z[first_layer_height] F200 ;move platform close to nozzle

becomes

G1 Z0.25 F200 ;move platform close to nozzle

or whatever your layer height is set to.

Here is a video of the new g-code in action:

I hope this has been added to the wiki. Good work, once again!

Former Solidoodle employee, no longer associated with the company.

15

Re: Improved start and end G-code

The new Slic3r 0.9.5 and Repetier-host 0.80 have fixed the issue with the slic3r variables. The start g-code will now work as stated in the first post.

16

Re: Improved start and end G-code

lawsy wrote:

The new Slic3r 0.9.5 and Repetier-host 0.80 have fixed the issue with the slic3r variables. The start g-code will now work as stated in the first post.

Exciting stuff! Good to see good software getting better.

Former Solidoodle employee, no longer associated with the company.

17 (edited by Donitz 2012-12-01 12:51:22)

Re: Improved start and end G-code

Been messing around with my new printer for a couple of days now. I'm so glad that it was a lot less hassle to get it working than I expected. Kudos to all the excellent guides by Ian and for you posting this code. I did find this g-code really useful even with PLA, but there were a few issues. I'm using slic3r 0.9.7.

Slic3r puts in its own extruder temperature instructions at the start of the g-code.

M104 S190 ; set temperature

This causes the extruder to remain heated for a long time before the bed temperature is reached, which isn't that good for PLA. I fixed this by overriding the temperature at the beginning of the start g-code with a relatively low temperature.

M104 S50            ; override slic3r extruder temp

The extruder temperature variable still didn't work so I had to put it in directly in the g-code.

M104 S185         ; start heating extruder

This instruction crashes the platform right down into the floor, so I removed it.

G1 Z150 F300 ; lower platform to bottom

When using PLA the anchor sometimes didn't stick to the platform, causing it to be dragged into the print and ruining the first layer. Instead I made the extruder lift from the platform after extruding the anchor, move to the side, go down again and scrape off the remaining plastic on its way to the print area.

start code:

M104 S50                    ; override slic3r extruder temp
G21                        ; set mm units
G28                         ; home all axes
M190 S60                 ; set and wait for bed temp to be reached
M104 S185                 ; start heating extruder
G90                        ; set absolute coordinates
G1 Z5 F300                ; move platform down 5mm
G1 X10 Y10 F3000             ; move to front left corner
M109 S185                ; wait for extruder temp to be reached
G1 Z[first_layer_height] F200    ; move platform to the first layer
G92 E0                    ; reset extrusion distance
G1 E10                    ; extrude anchor
G1 Z5 F300                ; move platform down 5mm
G1 Y20 F3000                 ; move away from the anchor
G1 Z[first_layer_height] F200    ; move platform to the first layer again
M140 S50                    ; lower bed temperature
end code:

G28 X0 Y0                ; home X axis and y axis
; G1 Z150 F300 crash the platform into the floor
M104 S0                    ; kill extruder temperature
M140 S0                    ; kill bed temperature
M84                        ; disable motors

18

Re: Improved start and end G-code

Does anyone else have trouble with lawsys start code using skeinforge?

I'm not exactly sure if it was anything I might have changed accidentally but it seemed like it wouldn't even do the extrude anchor and would then start print in front left where extrude anchor was to take place.  Repeatedly slamming off the non endstop side of x and y.

Also is there a setting of some sort I could fix in slicer 097 with regards to the extruder hear line of code that puts it like multiple extruders are present?

19

Re: Improved start and end G-code

are you running the latest firmware ?
that caused me problems initially..

20

Re: Improved start and end G-code

My printer was shipped in december. Is there a new firmware from what they'd send out lately? Using repetier and slicer works fine with this gcode but skinforge  and pronterface wont. I really won't have time to dig into it until the weekend. Running the original start gcode works,  id like to see the same start code run in both.

21

Re: Improved start and end G-code

lawsy wrote:

The new Slic3r 0.9.5 and Repetier-host 0.80 have fixed the issue with the slic3r variables. The start g-code will now work as stated in the first post.

Hi Lawzy,
where you referring to the extruder temperature triplet being fixed ?
if so .. what am I doing wrong with the start gcode then..

using rep host 0.82b and M190 S[temperature] is returning the M190 S195,195,195 for me..
repetier is set for a single extruder in printer settings.

ah well .. I might just drop the temps out entirely and use manual control top set them pre print and save reslicing ..

22

Re: Improved start and end G-code

Stoney wrote:
lawsy wrote:

The new Slic3r 0.9.5 and Repetier-host 0.80 have fixed the issue with the slic3r variables. The start g-code will now work as stated in the first post.

Hi Lawzy,
where you referring to the extruder temperature triplet being fixed ?
if so .. what am I doing wrong with the start gcode then..

using rep host 0.82b and M190 S[temperature] is returning the M190 S195,195,195 for me..
repetier is set for a single extruder in printer settings.

ah well .. I might just drop the temps out entirely and use manual control top set them pre print and save reslicing ..

You can edit the start gcode before printing to be correct.  I don't know if there's a clear cut way to stop this.

23

Re: Improved start and end G-code

Slightly modified your startcode because I was having issues with the anchor not sticking and this then pulling at the print, even with a skirt:

G21; set mm units
G28 ;home all axis
G90; set absolute coordinates
G92 E0; reset extruder distance
M104 S195; set extruder temp and start heating
G1 X145 Y145 F3000 ; move to back right corner
G1 Z0.05 F200 ;move platform close to nozzle
G1 E5 ;extrude anchor
G1 X10 F12000 ; move towards the back left as fast as firmware permits
G1 Z5 F300 ;move platform down 5mm
G92 E0; reset extruder distance
G1 Z[first_layer_height] F200 ;move platform close to nozzle

This pretty much successfully cleans the nozzle completely of any excess chaff, whipping it off with the rapid motion. It does result in a small gap in the skirt at the start though, but that is what the skirt is for.

24

Re: Improved start and end G-code

I've written some start G-codes that scrape off the nozzle on the side + thin straight line on right of bed.  I've never been happy with the dribble coming out of the nozzle when it heats up, plus the squirt at the back right (the 'anchor') often stuck to my nozzle.  I have many prints that are large, and the skirt would not be practical.  So, I crafted these start codes that seem to work well for me anyway.  I'm using it in Skeinforge, but I believe it will work in slic3r as well.  It will work with the 'old' firmware or the Lawsy 1.0 firmware, as it does not use the 'home' command to zero.  I have attached the file.  Use at your own risk, of course, and make a backup of your existing start codes.  Download the attached, and remove the 'txt' extension leaving start.code.  This can be copied directly into your C:\Program Files (x86)\Solidoodle v4.2\kliment-Printrun-dceaf26\skeinforge\skeinforge_application\alterations or similar folder - replacing your old start.gcode.

Features:
1) Sets the bed temperature to 90C, and waits until it's there.
2) Sets the nozzle to 195C, then waits until it's there.
3) Puts the platform down 5mm in case the old job ended with the nozzle up to the platform (like an abort)
4) Goes to the X-axis and Y-axis end stop switches
5) Goes to the Z-axis stop switch, twice - once fast, once slow as in the Solidoodle original skeinforge start.gcode
6) Does NOT center, rather sets these coordinates as absolute X82 Y76 Z0 (this centers the coordinates)
7) Runs a thin line along the right edge.  As it starts (on the way from X82 to X75) it takes the dribble off the nozzle and discards it at the right side edge of the bed.
8) After the thin line is done, the normal G-codes of your slice take over.

The thin line works like the anchor concept, except it is laid out on the bed and not left on the nozzle.  It is very easily removed, and really consumes only about .3mm from your potential X-axis bed range.

Much thanks to  lawsy and the other contributors!  I've learned tremendously from the information provided here!  best regards - lewis
______________________________________________________________
Start Code:

G21
G91
M140 S90 ;then set bed to 90
M190 S90 ;set and wait for bed temp of 90 to be reached
M104 S195 ; set extruder temp and start heating
M109 S195; wait for extruder temp to be reached
G1 Z5 F500; make sure nozzle not on bed
G1 X200 F3000
G1 Y200 F3000
G1 Z-200 F500
G1 Z5 F500
G1 Z-10 F250
G90
G92 X82 Y76 Z0 E0
G90
G21
S1.0
S2.1
G1 X74.96 Y-64.74 Z0.35 F2400.0
G1 F600.0
G1 E0.65
G1 F2400.0
G92 E0
G1 X74.96 Y-64.79 Z0.35 F519.3344 E0.002
G1 X75.04 Y-64.79 Z0.35 F519.3344 E0.0053
G1 X75.04 Y64.79 Z0.35 F519.3344 E5.4472
G1 X74.96 Y64.79 Z0.35 F519.3344 E5.4505
G1 X74.96 Y64.74 Z0.35 F519.3344 E5.4525
G1 F600.0
G1 E4.8525
G1 F519.3344
M104 S190.0
S2.1
G1 F600.0
G1 E4.2525
G1 F519.3344
G92 E0

25

Re: Improved start and end G-code

I often start prints remotely where I have no opportunity to clean any dangling oozed filament from the print head. I have been thinking of changing my start sequence to move the nozzle to the back corner of the print surface and zero the print bed before starting the heating of the extruder. The thinking is that once the nozzle heats to the pint where it would ooze, it will ooze the small distance to the surface of the print bed where it would cool enough to keep a significant amount from oozing out the print head. This would eliminate the dangling sting of extruded filament that is often present at the beginning of the print.

I am printing on a glass bed, so I dont think there are any real dangers of doing this, but I was curious if anyone is not doing this for a reason.

Any landmines I have not thought about?