Jump to content
UltiMaker Community of 3D Printing Experts

Strange gcode commands


Recommended Posts

Posted · Strange gcode commands



I am trying to produce a Python program which can find the centre of mass of an object from gcode. To help me with this, I have been using the "Turtle" module to draw each layer however, I am rather confused by the gcode that Cura is outputting. I am unable to work out which lines of code tell the extruder to move, and which ones actually command it to feed out filament. In normal gcode G0 indicates a move, and G1 indicates an extrusion, however this leads to gaps in my drawing due to large sections of G0 commands. Can anyone help me?





Cura seems to interpret all of these commands as extrudes, however by normal gcode the G0 commands should be moves.


G1 X112.925 Y123.311 E15.77568
G1 X113.785 Y123.718 E15.80733
G1 X114.682 Y124.039 E15.83901
G1 X115.606 Y124.269 E15.87068
G1 X116.548 Y124.409 E15.90236
G1 X117.5 Y124.456 E15.93406
G0 F6000 X117.5 Y124.896
G1 F1500 E9.43406
G0 F6000 X117.5 Y124.566
G0 X118.47 Y124.579
G0 X120.368 Y124.202
G0 X122.156 Y123.461
G0 X123.766 Y122.386
G0 X125.136 Y121.016
G0 X126.211 Y119.406
G0 X126.952 Y117.617
G0 X127.329 Y115.72
G0 X127.329 Y113.78
G0 X126.952 Y111.882
G0 X126.211 Y110.094
G0 X125.136 Y108.484
G0 X123.766 Y107.114
G0 X122.156 Y106.039
G0 X120.981 Y105.478
G0 X121.922 Y105.725
G0 X122.958 Y106.166
G0 X124.241 Y106.918
G0 X125.509 Y107.955
G0 X126.625 Y109.207
G0 X127.531 Y110.617
G0 X128.227 Y112.212
G0 X128.666 Y113.895
G0 X128.835 Y115.776
G0 X128.713 Y117.505
G0 X128.516 Y118.476
G0 X127.867 Y120.019
G0 X127.01 Y121.443
G0 X125.814 Y122.88
G0 X124.609 Y123.952
G0 X123.245 Y124.859
G0 X121.769 Y125.567
G0 X120.196 Y126.062
G0 X118.74 Y126.3
G0 X117.477 Y126.35
G1 F1500 E15.93406
G0 F6000 X117.476 Y126.55
G1 F1200 X116.916 Y126.535 E15.95269
G1 X116.369 Y126.495 E15.97093
G1 X115.806 Y126.427 E15.9898
G1 X115.257 Y126.335 E16.00831
G1 X114.723 Y126.219 E16.02649
G1 X114.183 Y126.073 E16.04509
G1 X113.642 Y125.902 E16.06396

  • Link to post
    Share on other sites

    Posted · Strange gcode commands

    G1 X117.5 Y124.456 E15.93406  > If there is an X and a Y and an E it's an extrusion
    G0 F6000 X117.5 Y124.896         > If there is an X and a Y (and maybe Z) without an E it's a travel move only
    G1 F1500 E9.43406                      > If there is no X and no Y but there is an E it's a retraction or prime.

    G92 E0    > Resets the extruder to 0.  Cura does that about every 10,000mm³ to minimize "rounding" errors.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • Our picks

      • New here? Get ahead with a free onboarding course
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 14 replies
    • Create New...