Meaning of G1 -2.000 F2400.000

  • I am working on g code for my homebrew 3d printer and i have found the line G1 -2.000 F2400.000. From what i understand there should be an axis before the number and x and y shouldnt have negative. I am using grbl which is for cnc milling but and i have been deleting this line with no problems but i am wondering what it does because i will be upgrading to a "real" 3d printer asap

  • G1 -2.000 F2400.000

    Is not valid G-code. As you note, -2.000 should be prefixed with an axis (X,Y,Z or E).

    Marlin would ignore the -2.000 bit and simply treat the command as equivalent to

    G1 F2400.000

    which doesn't perform any movement, but sets the feedrate for any future moves to 2400mm/min.

    x and y shouldnt have negative

    Not necessarily. Even though normally printing is done in the positive quadrant, negative values can be valid. Not only in relative movement mode, but even in absolute mode (for instance, if you set the center of your bed as (0,0) or if you use a negative z-axis offset the bring the nozzle closer to the bed).

  • G1 indicates a movement and -2.000 the distance, F2400.000 the feed rate mm/min, normally the (-) values are for retraction on extrusion E, for example:

    G0 X12 (move to 12mm on the X axis)

    G0 F1500 (Set the feedrate to 1500mm/minute)

    G1 X90.6 Y13.8 E22.4 (Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material)

    1. G1 F1500
    2. G1 X50 Y25.3 E22.4

    In the above example, we set the feedrate to 1500mm/minute on line 1, then move to 50mm on the X axis and 25.3mm on the Y axis while extruding 22.4mm of filament between the two points.

    1. G1 F1500
    2. G1 X50 Y25.3 E22.4 F3000

    However, in the above example, we set a feedrate of 1500 mm/minute on line 1, then do the move described above accelerating to a feedrate of 3000 mm/minute as it does so. The extrusion will accelerate along with the X and Y movement, so everything stays synchronized.

    So, in your case if some axis is not defined the feed rate applies to all motors.

    (part of this content is from reprap-wiki)

    You will see negative numbers if your starting point is on the center of the bed just like rectangular coordinates.

    G1 X-50.318 Y8.849 E11.70313 
    G1 X-52.606 Y3.087 E12.26689
    G1 X-53.240 Y1.297 E12.43953
    G1 X-54.398 Y-2.097 E12.76562
    G1 X-54.683 Y-2.995 E12.85132

    `So, in your case if some axis is not defined the feed rate applies to all motors.`. This is misleading. The feedrate always applies to all motors.

    It would be good to clearly delineate the text you took from the RepRap wiki by including it in a blockquote section. You can do this by prefixing the relevant lines by `> `. E.g., you might write "[...], RepRap wiki explains this in the following way:", followed by a quoted section.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM