Welcome! Log In Create A New Profile

Advanced

G-Code .. what is going on here?

Posted by AgeingHippy 
G-Code .. what is going on here?
January 03, 2011 11:32AM
Hello All

I used Reprap Host to generate a gcode file. Looking at the file some strange activity is going on which I do not clearly understand.

; GCode generated by RepRap Java Host Software
; Created: 2011-01-03:12-29-38
G21 ;metric is good!
G90 ;absolute positioning
M140 S55.0 ;set bed temperature and return
T0; select new extruder
M113; set extruder to use pot for PWM
G92 E0 ;zero the extruded length
G28; go home
G92 E0 ;zero the extruded length
G1 F5.0; feed for start of next move
G1 Z0.4125 F50.0 ;z move
G1 Z0.5875 ;z move
G1 Z1.0 F5.0 ;z move
G1 F1500.0; feed for start of next move
G1 X2.8 Y0.1 F3000.0 ;horizontal move
G1 X127.2 Y4.9 ;horizontal move
G1 X130.0 Y5.0 F1500.0 ;horizontal move
G28 Z0 ;set z 0
M109 S190.0 ;set temperature and wait
G1 F3000.0; feed for start of next move
G1 E1000.0; extruder dwell
G1 F1500.0; feed for start of next move
G1 F18000.0; feed for start of next move
G1 E960.0; extruder retraction
G1 F1500.0; feed for start of next move
G92 E0 ;zero the extruded length
;#!LAYER: 1/66
code continues with layer 1 gcode

Now I understand setting the temperature and zeroing the extruder position etc but I do not understand

G1 F5.0; feed for start of next move
G1 Z0.4125 F50.0 ;z move
G1 Z0.5875 ;z move
G1 Z1.0 F5.0 ;z move

Seems to move the extruder to 0.4125mm then to 0.5875mm then to 1mm.
Why does it not simply move directly to 1mm?

G1 F1500.0; feed for start of next move
G1 X2.8 Y0.1 F3000.0 ;horizontal move
G1 X127.2 Y4.9 ;horizontal move
G1 X130.0 Y5.0 F1500.0 ;horizontal move

Moves to X2.8 and Y0.1
then moves to X127.2 and Y4.9
then moves to X130 and Y5.0

Why not move directly to X130 and Y5.0 without the intermediate moves?

G28 Z0 ;set z 0
M109 S190.0 ;set temperature and wait
G1 F3000.0; feed for start of next move
G1 E1000.0; extruder dwell
G1 F1500.0; feed for start of next move
G1 F18000.0; feed for start of next move
G1 E960.0; extruder retraction
G1 F1500.0; feed for start of next move
G92 E0 ;zero the extruded length

We then move to Z0, set the temp and wait till it is reached.

Then extrude 1000mm of plastic?? what is going on here?

We set the feed rate twice. first 1500 and then 18000 and then retraqct the extruder by 40mm

All this is preparation before the first layer is printed. Could anyone please clarify what is going on here?

Thanks

Edited 1 time(s). Last edit at 01/03/2011 11:32AM by AgeingHippy.
Re: G-Code .. what is going on here?
January 03, 2011 12:57PM
AgeingHippy Wrote:
-------------------------------------------------------
> Hello All
>
> I used Reprap Host to generate a gcode file.
> Looking at the file some strange activity is going
> on which I do not clearly understand.
>
> ; GCode generated by RepRap Java Host Software
> ; Created: 2011-01-03:12-29-38
> G21 ;metric is good!
> G90 ;absolute positioning
> M140 S55.0 ;set bed temperature and return
> T0; select new extruder
> M113; set extruder to use pot for PWM
> G92 E0 ;zero the extruded length
> G28; go home
> G92 E0 ;zero the extruded length
> G1 F5.0; feed for start of next move
> G1 Z0.4125 F50.0 ;z move
> G1 Z0.5875 ;z move
> G1 Z1.0 F5.0 ;z move
> G1 F1500.0; feed for start of next move
> G1 X2.8 Y0.1 F3000.0 ;horizontal move
> G1 X127.2 Y4.9 ;horizontal move
> G1 X130.0 Y5.0 F1500.0 ;horizontal move
> G28 Z0 ;set z 0
> M109 S190.0 ;set temperature and wait
> G1 F3000.0; feed for start of next move
> G1 E1000.0; extruder dwell
> G1 F1500.0; feed for start of next move
> G1 F18000.0; feed for start of next move
> G1 E960.0; extruder retraction
> G1 F1500.0; feed for start of next move
> G92 E0 ;zero the extruded length
> ;#!LAYER: 1/66
> code continues with layer 1 gcode
>
> Now I understand setting the temperature and
> zeroing the extruder position etc but I do not
> understand
>
> G1 F5.0; feed for start of next move
> G1 Z0.4125 F50.0 ;z move
> G1 Z0.5875 ;z move
> G1 Z1.0 F5.0 ;z move

Because it is using acceleration. I.e. start at 5mm/ minute and then accelerate up to 50mm/m, then constant speed and then decelerate to 5mm/m before stopping. All very slow! I accelerate to 5mm/s over 250 steps.

>
> Seems to move the extruder to 0.4125mm then to
> 0.5875mm then to 1mm.
> Why does it not simply move directly to 1mm?
>
> G1 F1500.0; feed for start of next move
> G1 X2.8 Y0.1 F3000.0 ;horizontal move
> G1 X127.2 Y4.9 ;horizontal move
> G1 X130.0 Y5.0 F1500.0 ;horizontal move
>
> Moves to X2.8 and Y0.1
> then moves to X127.2 and Y4.9
> then moves to X130 and Y5.0
>
> Why not move directly to X130 and Y5.0 without the
> intermediate moves?

Again all for the acceleration. G-code has no acceleration notation, so Adrian accelerates from the last speed to the specified speed in the firmware, or at least that is my understanding.

>
> G28 Z0 ;set z 0
> M109 S190.0 ;set temperature and wait
> G1 F3000.0; feed for start of next move
> G1 E1000.0; extruder dwell
> G1 F1500.0; feed for start of next move
> G1 F18000.0; feed for start of next move
> G1 E960.0; extruder retraction
> G1 F1500.0; feed for start of next move
> G92 E0 ;zero the extruded length
>
> We then move to Z0, set the temp and wait till it
> is reached.
>
> Then extrude 1000mm of plastic?? what is going on
> here?

>
> We set the feed rate twice. first 1500 and then
> 18000 and then retraqct the extruder by 40mm
>
> All this is preparation before the first layer is
> printed. Could anyone please clarify what is going
> on here?
>
> Thanks

I am not sure exactly but during warm up the extruder tends to empty itself as the plastic expands so you need to prime it before the build by extruding say 50-100mm of plastic and then retracting to stop it oozing as it moves to the first point to be extruded.


[www.hydraraptor.blogspot.com]
Re: G-Code .. what is going on here?
January 03, 2011 02:25PM
Thanks for that Nop

It does explain much.

G1 E1000.0; extruder dwell
G1 F1500.0; feed for start of next move
G1 F18000.0; feed for start of next move
G1 E960.0; extruder retraction

Seems somewhat excessive to extrude 1 meter (1000mm) worth of plastic to prime the extruder.... which is about 3.6cm of feedstock by my calculations.

Also setting the feed rate to 1500 and then immediately to 18000 before retracting - does that not make the 1500 superfluous?

finally, after retracting the current extruder position is set to 0.. would we not be missing the 40mm of filament when we actually start extruding to build?

Cheers
Re: G-Code .. what is going on here?
January 03, 2011 03:22PM
AgeingHippy Wrote:
-------------------------------------------------------
> Thanks for that Nop
>
> It does explain much.
>
> G1 E1000.0; extruder dwell
> G1 F1500.0; feed for start of next move
> G1 F18000.0; feed for start of next move
> G1 E960.0; extruder retraction
>
> Seems somewhat excessive to extrude 1 meter
> (1000mm) worth of plastic to prime the
> extruder.... which is about 3.6cm of feedstock by
> my calculations.

Yes seems like 10 times too much to me, not sure why.

>
> Also setting the feed rate to 1500 and then
> immediately to 18000 before retracting - does that
> not make the 1500 superfluous?

Yes it looks redundant to me, but it is the first time I have looked at this.

>
> finally, after retracting the current extruder
> position is set to 0.. would we not be missing the
> 40mm of filament when we actually start extruding
> to build?
>
> Cheers

It should fast forward 40mm before moving off for the first filament run otherwise, yes, there would be a deficit. It should do this on every filament run.


[www.hydraraptor.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login