Jump to content

Calibration utility: leveling-rings.gcode


stevegt

Recommended Posts

Posted · Calibration utility: leveling-rings.gcode

Hi All,

I wrote a little snippet of g-code that helps greatly when checking bed leveling, and gives you a chance to twist the thumbscrews in real time for fine-tuning. I wrote this while troubleshooting a Z homing bug in Ultimaker2Marlin 14.03, and it's become my standard quick "warm-up" print at the beginning of each session.

What it does is lay down a concentric set of rings, 150 mm diameter, in a single .1 mm layer. When your printer is calibrated correctly, you'll see these rings' edges touching, or nearly so. Glass too high means you mash the glass into the nozzle and get little or no plastic, glass too low means you get dribbles.

You'll quickly get good at twiddling the bed height thumbscrews screws while it's slowly circling; your goal is to make the rings nice and even all the way around, like the photos below.

The gcode is actually generated by a python script -- I've uploaded both to https://github.com/stevegt/UltimakerUtils.

In case you're wondering if that Z homing bug affects you, this is a good way to check; level your bed, then print these rings, then turn the power off, gently push the bed all the way down if it doesn't fall on its own, then power on and print these rings again, then print them again without cycling the power. If the bug affects you, then you'll have the devil of a time getting consistent results -- in my case, it kept printing about .7 mm too high or too low. For more information about the bug, as well as both a workaround and a firmware patch, see http://umforum.ultimaker.com/index.php?/topic/5935-z-axis-homing-inconsistent-on-um2-workaround-and-patch/.

leveling rings

leveling rings closeup

 

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Another quick test to see if you have the leveling bug - turn off power, push the bed all the way down until it stops. Then twist the Z screw and count how many clicks you feel until you hear the Z level switch click off. I get 16 or 17. Take that result and divide by 6.25 and that's how many mm that distance is. If that distance is > 3mm then you have a leveling problem (won't be repeatable). If you get 19 or more, then fix by bending the Z limit switch arm slightly.

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    LOL, my gcode needs a little work.... Unless I just invented the gcode spirograph....

     

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    HA suck it you UM2 elite bastards! (I'm joking)....

     

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    WP 20140603 020

    0.15mm layer.

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Python code to generate circle gcode for UM1.

    NOTE: someone needs to check my calculations especially around the extrusion amount.

     


    #!/usr/bin/python
    filament_diameter = 2.89
    build_area_width = 205.0
    build_area_depth = 205.0
    rings = 10
    wide = 0.4
    thick = 0.2925 / 2
    temperature = 230
    bed_temperature = 60
    base_dia = 180
    pi=3.1415927
    center_x = build_area_width/2.0
    center_y = build_area_depth/2.0
    filament_area = (filament_diameter / 2) ** 2 * pi
    head = '''
    M107 ;start with the fan off
    G21 ;metric values
    G90 ;absolute positioning
    M82 ;set extruder to absolute mode
    M107 ;start with the fan off
    G28 X0 Y0 ;move X/Y to min endstops
    G28 Z0 ;move Z to min endstops
    G1 Z15.0 F9000 ;move the platform down 15mm
    M140 S{bed_temperature:.2f} ;set bed temp (no wait)
    M109 T0 S{temperature:.2f} ;set extruder temp (wait)
    M190 S{bed_temperature:.2f} ;set bed temp (wait)
    G92 E0 ;zero the extruded length
    G1 F200 E3 ;extrude 3mm of feed stock
    G92 E0 ;zero the extruded length again
    G1 F9000 ;set speed to 9000
    ;Put printing message on LCD screen
    M117 Printing...
    ;Layer count: 1
    ;LAYER:0
    '''
    loop = '''
    G0 F9000 X{x:.2f} Y{y:.2f} Z{z:.2f}
    G2 F1000 X{x:.2f} Y{y:.2f} I{r:.2f} E{total_mm3:.2f}'''
    tail = '''
    ;End GCode
    M104 S0 ;extruder heater off
    M140 S0 ;heated bed heater off (if you have it)
    G91 ;relative positioning
    G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
    G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more
    G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
    M84 ;steppers off
    G90 ;absolute positioning'''
    total_mm3 = 0
    body = ''
    cross_section = thick * wide
    z = thick
    for i in range(rings):
    dia = base_dia - ((wide * 2) * i)
    circumference = pi * dia
    r = dia/2.0;
    x = center_x - r
    y = center_y
    mm3 = (circumference * cross_section) / filament_area
    total_mm3 += mm3
    body += loop.format(**vars())
    print head.format(**vars())
    print body
    print tail.format(**vars())

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Python code to generate circle gcode for UM1.

    NOTE: someone needs to check my calculations especially around the extrusion amount.

     

    Very cool. I'll see if I get a chance to check the math for you tomorrow -- where did the 0.2925 number come from? Or is that one of those black magic UM1 potions that wood machine masters keep under wraps? ;-)

    Is it okay if I add that script to the github repository alongside the UM2 version? Or even -- horrors -- merge the two scripts? I'd want to credit you either way (GPL okay?).

    Steve

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Hey Steve,

    Yeah the .2925 is one of those magic numbers which is a multiple of the Z steps. It's probably better to change it to .3 so people don't wonder about it.

    You did most of the work, I just added the UM1 start and end gcode and the adjustment for the extrusion amount.

    I don't need credit and you can incorporate it as you see fit.

    The only thing is I accept NO liability for any damage done but using either version or any derivatives. USE AT YOUR OWN RISK.

    (lawyers..... sigh).

     

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Anon, haha good work. Love your style!

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    If Steve is going to host the UM1 version in the same place or combine them, may I suggest that the moderators change the thread title to not be specific to the UM2 with Steve's permission?

    Then delete my other thread as it is both redundant and duplicative....

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    That sounds great but should I do that now or wait until steve finishes with combining?

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    I'll defer to Steve because it's his thread, I don't what to tell you to change somebody else's thread. Assuming he is OK with it, change the thread title immediately since the UM1 info and discussion is already here even if it never is merged with the UM2 version and gcode in github and then delete mine (it was stupid to make it... sorry, I was riding high on the UM1 circle pr0n).

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Hey George,

    Go ahead and change the thread title (just delete the "UM2"?).

    Thanks anon, I'll get it into github, probably add some docs there as well.

    Steve

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Okay, it's all in github, I've renamed the repository on github as well, added a README, and adjusted the URL in my first post above accordingly.

    Still haven't gotten around to checking that math. ;-)

    Steve

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    I've finally gotten around to try this and it's fantastic! Thank you so much for writing this. Managed to perfectly calibrate my poor neglected printer within minutes.

    Since I have a UM1 without a heated bed, I used the https://github.com/markdeklerk/UltimakerUtils/blob/712ca4432df42e686d093931bc2c515927c6e630/leveling-rings-UM1.gcode by markdeklerk.

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    Hello everyone,

    I've just done the ring test with the UM2 and I'd like to know from people more expert than me what you think.

    Here the link for the pictures: https://www.dropbox.com/sh/u4gn2rh8rpcu0u2/AACS0CyL0PCf6lFX_ZAAXu1ca?dl=0

    Thanks and cheers

    matteo

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    I'm definitely not an expert and only have a UM1 but to me it looks like the circles aren't touching and that indicates a problem. When cooled, the print should be on piece and not come about into threads easily.

    I would do the test and let the print cool then carefully remove it. Then measure it's thickness with calipers. It should be the same as the layer height in the script. If the thickness is too high, twist the bed screws such that the bed moves up towards the nozzle and retest.

    If the thickness is about the same as the layer height then you have under-extrusion. With the calipers, measure the width of the filament in various locations and orientations (rotate the calipers around the filament) and average the results. Then set that average as the filament diameter in the printer and retest.

    If the current setting is about the same as what you measured, you'll need to wait for others to help as you have an issue with the feeder or nozzle which are too different from the UM1 for me to help.

    If that is the case, I suggest you start a new thread.

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    since i don't have a python box running ATM, is there a GCODE we can use for the UM2 as well?

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    nevermind.. i should really learn to read..

     

  • Link to post
    Share on other sites

    Posted · Calibration utility: leveling-rings.gcode

    This remains one of my favorite (and most printed) gcode scripts :)

     

  • 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

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
        • 0 replies
    ×
    ×
    • Create New...