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

Z offset for different slicers

Discussion in 'Software' started by Kingbob, Aug 19, 2014.

  1. Kingbob

    Kingbob Active Member

    Joined:
    May 22, 2014
    Messages:
    104
    Likes Received:
    33
    I have a model that i was trying to print from Matter Control using Slicer by default, but it just sat there saying "Saving Intermediate File". A search here quickly established that its a known issue that happens sometimes, and the suggestion was to try a different slicer.

    Switched over to Matterslice, and presto, sliced and ready to print in a few seconds.

    But, when i started the print it tore up the tape on the bed like it was ignoring the Z offset. Checked, and there was no Z offset. If i switch to Slicer, the Z offset box appears, but with Matterslice or Cura, it disappears.

    Is there a way to get the other slicers to recognise the Z offset at all?
     
  2. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    I use the g-code method.

    In the start-up g-code there's a M565 Z0, change that to your offset value in a negative. If your offsets .5 input:

    M565 Z-0.5


    alternative:

    G1 Z0.5 ;Raise Nozzle .5mm
    G92 Z0 ;Force new Z0
     
    #2 Mike Kelly, Aug 19, 2014
    Last edited by a moderator: Sep 13, 2014
  3. Kingbob

    Kingbob Active Member

    Joined:
    May 22, 2014
    Messages:
    104
    Likes Received:
    33
    Did the trick! Thanks Mike!
     
  4. Bjorn

    Bjorn Member

    Joined:
    Aug 29, 2014
    Messages:
    77
    Likes Received:
    74
    Hi all,

    Its my first post :), but i have a question about this offset method.
    I have the R1 with both switches on each side..
    When I calibrate it, the nozzle is exactly on the bed.
    Should I apply this offset method in all my code to raise the nozzle a bit?
     
  5. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    Just before the start of the print. The rest of the layers will compensate.
     
  6. Bjorn

    Bjorn Member

    Joined:
    Aug 29, 2014
    Messages:
    77
    Likes Received:
    74
    Hi,

    I am playing with the M565 command but i dont see any difference..
    It looks like it is not recognizing the command..
    My head is about 0.7mm above the bed..
    So I have entered M565 Z-0.7 but it keeps diving into the bed..

    So i played with the command itself.. setting extreme offsets.. but it doesnt have any effect.. :S
     
  7. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The M565 command needs to be just before the G29 in your start up gcode.

    If you have already done that and it does not work then I suggest you post your start up g code here
     
  8. Bjorn

    Bjorn Member

    Joined:
    Aug 29, 2014
    Messages:
    77
    Likes Received:
    74
    Hi Ziggy,

    I have tried that too..

    What i have done now is bringing the extruder to my offset point.. then G92 Z0 to offset it, and bring it back up.
    These 3 lines i have replaced with the M565 code, without succes.

    Code:
    ; Default start code
    G28 ; Home extruder
    G1 Z15 F{Z_TRAVEL_SPEED}
    M107 ; Turn off fan
    G90 ; Absolute positioning
    M82 ; Extruder in absolute mode
    G1 Z0.7 ; Brings Extruder to the Z offset point
    G92 Z0 ; Defines the new 0 offset
    G0 Z10 ; Bring extruder up from bed
    {IF_BED}M190 S{BED}
    ; Activate all used extruder
    {IF_EXT0}M104 T0 S{TEMP0}
    G92 E0 ; Reset extruder position
    ; Wait for all used extruders to reach temperature
    {IF_EXT0}M109 T0 S{TEMP0}
     
  9. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    I have seen a number of posts mention using gcode M565 Z<offset> as a way to change the Z Offset value (including some of my posts).

    I do not use the M565 gcode, but I just assumed that because it was in the Robo/MatterControl startup gcode that the M565 gcode must work in Marlin. The gcode wiki also says it works.

    However today because of Bjorn's comments, I went looking for the coding in Marlin that changes the Z Offset based on the M565 parameter. I could not find it at all.

    As far as I can see M565 IS NOT IMPLEMENTED in Marlin.

    If I am right, then trying to change the Z Offset using M565 will never work and would explain (at least in part) why so many Robo'ers are having Auto Leveling troubles.

    edit: I'm certain M565 is not implemented in Marlin. To prove it to myself I added some code to Marlin to check if M565 was being actioned - and it isn't.
     
    #9 Ziggy, Sep 12, 2014
    Last edited by a moderator: Sep 13, 2014
    4 people like this.
  10. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Well, isn't THAT special :(
    I am glad someone took the time to wade through that code. Thanks!
     
  11. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    This is why I personally always do the G92 method.

    Ziggy what software were you testing in?
     
    #11 Mike Kelly, Sep 13, 2014
    Last edited by a moderator: Sep 13, 2014
  12. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    Mike, I was testing in Marlin by adding some debug code and sending M565 manually. The control software (MC, RH or what ever) makes no difference as the M565 gcode is ignored in Marlin - not even an error code.

    Again, to make sure, I added some code in Marlin to interpret the M565 command and change the Z Offset - this new code does change the Z Offset correctly. I could see the changed value on the LCD and in the behaviour of the auto leveling.

    It's not that difficult to add the firmware code for the M565 to work in Marlin. And the M565 command would be a very useful command to have available. But that means updating the firmware -and not everyone wants to do that.
     
    2 people like this.
  13. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Sounds like a Ziggy patch ;)
     
  14. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    Right that all makes sense. I just wanted to make sure it wasn't some weird MatterControl thing.
     
  15. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    I guess the real question is - Is it worth creating a patched version of Marlin to implement the M565?

    The other side of the question is if the M565 is not implemented then:

    - Can't run auto leveling from the SD Card without reflashing the Marlin firmware with the correct Z Offset

    - Can't use Repetier Host if you have Auto Leveling without reflashing the firmware with the correct Z Offset or using the G92 process. Not sure if MatterControl or Simplify3d have a way to avoid using M565?

    - Any other control software which relies on setting the Z Offset won't work properly

    I have decided I will continue to use my M565 patched Marlin version as it is useful to be able to test, tweak and check the Z Offset without reflashing.
     
  16. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    This M565 thing gets more interesting

    • In the Robo 3_14_14 version of Marlin - no M565
    • GitHub Marlin (latest version) - no M565
    • But Robo version Auto_Level_6_10 - M565 code has been added!! But not completely as only the Z Offset works. The X and Y parameters are ignored. There is also a tweak added so if you issue the M565 without parameters, the current Z offset value is returned.

    So I have to assume someone at Robo has added the M565 patched code in the Auto Level version of Marlin.
     
    #16 Ziggy, Sep 14, 2014
    Last edited by a moderator: Sep 14, 2014
  17. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    Another Auto Leveling quirk I realised is a design "feature" of Marlin:

    If the following sequence of gcode is executed

    G28 ; home X, Y and probe Z
    G29 ; probe bed

    Then Marlin remembers the result of the bed probe and the plane of the bed to adjust the Z during the print

    HOWEVER if you home the X,Y again after the probing like this

    G28 ; home X, Y and probe Z
    G29 ; probe bed
    G28 X0 Y0 ; home again

    Then the results of the G29 probing are lost and auto leveling does not work. This behaviur does not seem to be documented anywhere.
     
  18. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    I would figure that's to be expected as a home is basically a positional reset. It doesn't assume anything about previous coordinates once the home command is triggered. For all it knows it doesn't home consistently so it doesn't want to assume that the previous values are consistent.
     
  19. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    If Z had been homed (or its real position lost) I would agree. But no reason to reset the bed plane info when moving X or Y to the 0 position .
     
  20. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,276
    But it can't know for certain the X and Y coordinates for those Z values are accurate.
     

Share This Page