1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

G90 Gcode question

Discussion in 'Software' started by supercazzola, Aug 5, 2017.

  1. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    424
    Likes Received:
    111
    Just diving into trying to understand g-code, in particular what Robo ships for the Octoprint presets. Just curious, at the end of the After the Print Job Completed script, I see them set to absolute positioning (G90) and then move the printer to the (0,0) spot on the current z level, then move the bed down to z=0, but then they set the absolute position mode again (with another G90 command). Why would one do this?
    Is it just an oversight, or is there more to the G90 command?
    thanks

    ; turn off heaters
    M104 S0
    M140 S0
    ; turn off fans
    M107
    ; move bed down 10mm
    G91
    G1 Z10
    G90
    ; home XY axis
    G28 X0 Y0
    ; home bed
    G28 Z0
    ; set absolute mode
    G90
    ; zero extruder
    G92 E0
    ; turn off motors
    M84
     
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Well, not sure.

    On a CNC machine you really want to "beware" of absolute mode just due to the way it calculates the moves. Is it always bad? No, but you want to make sure you know what you meant...mixing that with relative mode is... potentially a problem. @Geof might have more insight on that side :)

    On the printer I am not sure why they would need an extra G90 unless one of the G28 calls was resetting it to relative mode (and I am pretty sure that is not the case).
     
    supercazzola likes this.
  3. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    424
    Likes Received:
    111
    thanks. I'm assuming the relative mode is cause you really just want to move the bed down 10 from wherever you are at the moment (and since prints are different heights, the z could be anywhere when it finishes the print). The absolute mode is clear too, as the origin is the origin, and the bottom of the print volume is what it is regardless of where you are in the workspace.

    I notice the same second G90 call in the After Print Job Is Canceled script too. Maybe a cut and paste, or like you suggest, maybe there is more to some of the commands between the two G90s
     
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
  5. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,757
    Likes Received:
    2,339
    Absolute zero is literally that. In the cnc world you stay away from absolute zero of a machine to avoid a crash (expensive)

    Instead you set a zero off your part to machine.


    In 3dprinting...meh lol
     
    mark tomlinson likes this.

Share This Page