creating a "StartGCode.g" file
-
Re: Printer does not recognize bed size
Hello, I would like to deposit a start code and an end code. An old discussion recommended creating a "StartGCode.g" file and a "PrimeNozzle.g". How are they supposed to look like? What orders?
-
@axiom the code you put in start.g is similar to what you might put in the slicer start GCode although you may want to make it conditional. Examples:
- If the X and/or Y axes are not flagged as having been homed, run G28
- Else if you have a Z probe, move the head to e.g. 5mm above bed centre and run G30 (because the Z=0 position may drift due to thermal expansion)
- If you have previously created and stored a height map, load it using G29 S1
- If the slicer you are using doesn't automatically select a tool, execute T0 to select your main (or only) tool
- Prime the extruder, unless you rely on printing the skirt to do that
- If you have filament sensors configured, check that they are not reporting out-of-filament
-
@axiom To expand on what DC has said, you might also consider using some of the things that I do. For example, slicers tend to do things sequentially whereas you can save some time by doing them concurrently. That is to say, on my machine, the thing that takes the longest time is heating the bed. So the very first thing I do is start that process. Once the bed has reached say 40 Deg C, I start heating the hot end, start the homing process, and continue to heating the bed to say 60 Deg C. Once homing is completed and the nozzle is fully up to print temperature, I prime and wipe the nozzle. Then finally wait for all temperatures to stabilise at their set points. The net result is that everything that needs to happen, gets done in the shortest possible time which is the time it takes to heat the bed. Conditional gcode is a great help in achieving this.
-
@dc42 Is this the right interpretation of what you´ve wirtten?:
; Start code for RepRap; Check if X and Y axes are flagged as homed
if ( !isHomed(X) || !isHomed(Y) ) {
G28 ; Run homing command
} else {
; Check if a Z probe is present
if ( hasZProbe() ) {
G1 Z5 F200 ; Move head to 5mm above bed center
G30 ; Run Z probe
}; Check if height map is present if ( hasHeightMap() ) { G29 S1 ; Load height map } ; Check if tool is selected if ( !isToolSelected() ) { T0 ; Select main/only tool } ; Prime extruder G1 E50 F300 ; Extrude 50mm at a speed of 300mm/min ; Check filament sensors if ( outOfFilament() ) { M600 ; Pause printing and wait for filament change }
}
-
@axiom you need to have a look here:
https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands
and here:
https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentationthe functions you reference in your example "hasHeightHap()" etc are not meta gcode.