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

Solved Z-Axis Auto Leveling Routine Inconsistantly Starting

Discussion in 'Troubleshooting' started by Tanbam, Dec 20, 2014.

  1. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    It appears the problem is that your start gcode needs to explicitly home X and Y. When autolevelling is enabled, in marlin firmware speak a G28 is not always the same as a G28 X0 Y0. Marlin has implemented some convoluted logic in this area to minimse the chance of the extruder crashing into the bed or moving outside the bed.

    I think this modification to the first G28 command in your start code will solve the problem.

    G28 X0 Y0 ; home X and Y
    G1 Z5 F5000 ; lift nozzle
    M109 S[temperature] ; set the extruder temp and wait
    G28 Z0 ; Home Z again in case there was filament on nozzle
    M565 Z0
    G29 ; probe the bed


    And I would like to know exactly where you got your firmware. I suspect there have been some subtle changes to the G28 gcode functionality.
     
  2. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    I downloaded the firmware from the Robo3D firmware page under Support -> Technical Support.

    I'll add your start code modification as soon as the current print finishes.
     
  3. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    I have tested the modded start code on my Robo and it works 100% reliably. (I have firmware from April 2014 which I have added some of my own modifications)

    Your unmodified start code also works reliably on my Robo. So I am now pretty well convinced there are some changes to the G28 function in the latest firmware from the Robo website.
     
  4. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    This also happens with the firmware that MatterControl tells me is the latest available, which isn't the same one as what's on the Robo3D website, so whatever it is, it's common to both.

    What I haven't done is try to see if preheating the bed/extruder affects it. I'm wondering if the wait for everything to come up to temp is somehow affecting it. Sometimes I preheat, sometimes I don't, and now I think that might be related.
     
  5. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The log is showing the issue is with X and Y not homed before the auto levelling/Z. I believe that changing the first G28 to G28 Xo Y0 will fix it.

    Please try that first.
     
  6. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    I just read about someone else with the exact same issue on another forum, so at least it's not just me!
     
  7. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    Ok, it's almost certainly related to the delay when heating.

    I turned on the printer, then loaded a print using your modified G28. Instead of going to the center and waiting there, it went to the front-left, which I prefer instead of dead-center. When the extruder comes down, it always leaves a plastic booger that I try to remove before the printing starts.

    I did not preheat the bed and extruder; I let the system do it all. When it finally reached temperature, the print began at the same z level as it was when it finished the last print - about three inches off of the bed. No bed probe, and the extruder never went down at all.

    I preheated the bed and extruder, then tried the print again. The bed probe occurred, and the print was successful.

    I did it again, waiting until the extruder cooled to about 180, then started the print again. After the wait for the extruder to heat up, the bed probe was again skipped and the print was a bit too close to the bed.

    One last time, I preheated the bed and extruder before starting the print, and it bed probe worked exactly as expected.

    I think I'm going to try to move the M109 command to the top of the start code list and see if it fixes my problem. It shouldn't matter that the extruder heats before the machine finds its home positions, right?
     
  8. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    Ok, that's the trick!

    Moving the M109 to the beginning of the start code seems to fix the problem.

    The G28 Xo Y0 modification also seems to be desirable, since it keeps the head from leaving dribbled filament in the center of the bed.

    I'm going to keep using this for a few more prints and see if the problem is resolved. If so, I'll mark the thread as such.

    Thanks a ton for helping me figure this out. I don't know if I'd have been brave enough to start monkeying around with the start code without a lot more research.
     
  9. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    Believe me the position of the M109 gcode does not make any real difference.

    The log is telling the truth. It is the X and Y not being seen to homed before the G29 which is the symptom pointing to the real root cause.

    I have had a close look at the Robo marlin firmware. I can see there is a obvious bug in the handling of the G1 code which has a flow on effect to the G28 and the X and Y homing positions.

    I have pretty much confirmed the bug is there by comparing with the latest Marlin on github.

    Not sure how much you know C but ......

    Marlin G1 issue001.jpg

    File on the left is Robo auto level 8mm. On the right is vanilla Marlin from github.

    As you can see Robo have commented out the break after the G1 function code. This means all of the code following will also be executed whenever a G1 is received and the condition "stopped == true". As it happens that code also includes the G28 function (which is further down in the code than my screenshot shows).

    So I think this bug and the

    G1 Z5 F5000 ; lift nozzle

    in your start code is contributing to and may be the root cause of the symptoms you are seeing.

    Very few Robo users would have G1 early in their start code. This may be the reason the symptoms haven't been reported before.

    EDIT : Appears this last statement is no longer true. A G1 is embedded in the MatterControl start code
     
    #29 Ziggy, Dec 23, 2014
    Last edited by a moderator: Dec 23, 2014
  10. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,277
    *cough*
    startup gcode.PNG
     
  11. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    OMG so this is standard MatterControl with a G1.

    Another good reason not to use MatterControl
     
  12. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,277
    Yeah I'm pretty sure matterhackers have absolutely no idea what they're doing
     
  13. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    After moving the M109 line to the top of my start code, I've been able to print a number of times without the bed probe being skipped. Thanks to Ziggy and Mike for helping me home onto the problem.
     
    #33 Tanbam, Dec 23, 2014
    Last edited by a moderator: Dec 23, 2014
  14. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    Tanbam,

    All good that you are happy it now works.

    For anyone reading this thread in the future, the reason for the G29 not working is that the firmware thought the X and Y were not homed. Add a G28 X0 Y0 before the G29 and that should fix the issue.
     
  15. Jsn9955

    Jsn9955 Member

    Joined:
    Dec 18, 2014
    Messages:
    31
    Likes Received:
    14
    I encountered this issue last night. While trying to print using MC and connected to the computer via USB, I've never had an issue with the auto level (only had the printer for 3 days now so might just not have encountered the problem yet)... Unfortunately, about 40 minutes into the print USB connection was lost and the print stopped... After screwing around for half an hour, I finally got the software to recognize the SD card and got the file onto it. hit print, and trying to run the file from the card, no auto level was performed and it started to print just as described in the very first post in this thread...

    I will double check the file on the SD card tonight and check to see how the gcode looks compared the file on the computer to what you guys are doing here, make suggested adjustments as recommended and see what happens.
     
  16. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    I'm not exactly sure why it happens, but it seems as if the printer with the latest firmware "forgets" that it found the X/Y home settings if it spends too much time heating up.

    The stock MatterControl start code runs perfectly only if the printer is preheated. I have not spent too much time trying to figure out what that threshold is, but if it takes more than a couple of minutes to come up to temperature, the X/Y home positions are lost and the bed probe G-Code is skipped.

    Ziggy's suggestion of the G28 X0 Y0 solves this issue, as does simply rearranging the original qG-Code start code order. Either one of these solutions will cause the printer to find the X/Y home positions after the printer has reached the target temperature. I personally like Ziggy's suggestion because it moves the filament goop that is always there when the printer heats up to the front-left corner, instead of right in the center of the bed.
     
  17. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The inactivity time (ie 60 seconds) after which the steppers are disabled is set in configuration_adv.h

    //default stepper release if idle
    #define DEFAULT_STEPPER_DEACTIVE_TIME 60​

    When the steppers are disabled, all information regarding the position of the X and Y steppers (including whether they are homed) is reset. This is also explained in configuration.h in the comments associated with Z safe homing.

    //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
    //it is highly recommended you let this Z_SAFE_HOMING enabled!!!

    #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
    // When defined, it will:
    // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
    // - If stepper drivers timeout, it will need X and Y homing again before Z homing
    // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
    // - Block Z homing only when the probe is outside bed area.​


    So the best approach is to home X and Y (G28 X0 Y0) immediately before the G29.
     
    #37 Ziggy, Dec 24, 2014
    Last edited by a moderator: Dec 24, 2014
  18. Tanbam

    Tanbam Member

    Joined:
    Dec 20, 2014
    Messages:
    84
    Likes Received:
    28
    Well, snap, that finally explains everything!

    The only reason that I would want to move the temperature command higher up would be to avoid having 2 sets of homing movements. I've already mentioned that I find G28 X0 Y0 superior because it places the extruder in a better position than the stock start code. Instead of having two G28 (non Z) commands, I only use one now, the one you recommend, after the temperature is reached.

    I'd be willing to try something other than MatterControl, but I've been having such good results with my machine that I haven't seen the need yet. I was getting some Z ribbing, but I adjusted the left threaded rod which was very wobbly and I get nice, straight sides now.

    It's running so well that even my kids are using it with no trouble, with a spool of black ABS. Now that the auto level is taken care of, the printer is running almost constantly - though my wife isn't too happy about it, being in her kitchen and all...
     
    John Burgardt likes this.
  19. Jsn9955

    Jsn9955 Member

    Joined:
    Dec 18, 2014
    Messages:
    31
    Likes Received:
    14
    Excellent explanation. I reworked my "start g-code" in MC tonight before I tried my first print from the SD card, and it worked flawlessly. Only one hic-up but it might have been something I did. Not enough to cause problems though.

    Thanks everyone that put in their input to this thread, it's worth reading, and fixed my problem.
     
  20. Ben R

    Ben R Active Member

    Joined:
    Nov 21, 2014
    Messages:
    651
    Likes Received:
    89
    I get the same thing... strange... sometimes it just starts up and skips the g29... sometimes it does it. More often does it than not.
    Have considerable problems with it if I try to use straight Gcode files. Usually have to go in and edit them.
     

Share This Page