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

Marlin for the R2 - UBL Enabled

Discussion in 'Mods and Upgrades' started by WheresWaldo, Sep 8, 2017.

?

Would you like to see U.B.L. enabled for the R2?

  1. Of course!

    31 vote(s)
    93.9%
  2. Not really.

    1 vote(s)
    3.0%
  3. Why are you wasting your time with this?

    1 vote(s)
    3.0%
  1. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Looks like I need to use M206 Z0 every time to clear the Z-Offset before resetting it for some reason.
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Do not use the Wizard, And resetting to 0 should not be necessary, make your change then before testing it make sure you save the setting to EEPROM with M500.

    You may also need to clean off the IR sensor on the back of the extruder assembly.
     
    #102 WheresWaldo, Mar 30, 2018
    Last edited: Apr 6, 2018
  3. studiver13

    studiver13 New Member

    Joined:
    Dec 28, 2017
    Messages:
    22
    Likes Received:
    8
    I have been following these directions and after getting a glass bed they have really helped with making a nice level bed. I created a design to help test a level bed and to show what points may need adjusting. Feel free to use it!
    https://www.thingiverse.com/thing:2852366
     
    WheresWaldo and supercazzola like this.
  4. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    I've got a slight problem with my UBL bed leveling. When I issue the G26 command for a mesh print, I get this error on the right side of the bed:

    Recv: yl_i out of bounds in z_correction_for_y_on_vertical_mesh_line(ly0=195.00, xi=4, y1_i=5)
    Recv: yi out of bounds in z_correction_for_x_on_horizontal_mesh_line(lx0=195.00,x1_i=5,yi=4)
    Recv: yi out of bounds in z_correction_for_x_on_horizontal_mesh_line(lx0=195.00,x1_i=5,yi=3)
    Recv: yi out of bounds in z_correction_for_x_on_horizontal_mesh_line(lx0=195.00,x1_i=5,yi=2)
    Recv: yi out of bounds in z_correction_for_x_on_horizontal_mesh_line(lx0=195.00,x1_i=5,yi=1)

    On that side, it always prints way too high. Granted, this really doesn't matter much in the way of my prints because I never print that far on the right of the bed. But, it's annoying as hell and I want to fix it. I'm assuming I can just increase the 'size of the print bed' in the Configuration.h file, but I wanted to see if I'm right first and if anyone else has run into this problem before. Help would be much appreciated.

    p.s. I think this is happening on the 'top' part of the bed as well.
     
    #104 adikted2astro, May 2, 2018
    Last edited: May 2, 2018
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    There is something I am missing on the parameters, for some reason it thinks the probe point is outside of the printable range. let me see if I ever fixed that in my own code. The problem is I make so many changes, testing this and that, sometimes I forget which one of my branches has the most up-to-date code in it. Kind of the way a lot of programmers are commit something then revert the commit when you find out it doesn't work as expected. I usually skip the commit part until after I tested it.
     
  6. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    I'm not entirely sure which code I'm using, but I believe it is the same as yours. I can't remember if I downloaded your code, or Mark's. All I know is it's version 1.8.3.


    I have also confirmed it is happening on the top part of the bed too.
     
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Don't know what 1.8.3 is unless you are speaking of the Arduino IDE which currently is at 1.8.5

    Marlin is 1.1.8

    I think I know what the issue is but don't know how to fix it. The MESH is inset on the bed to make sure that the IR probe is always on the bed, since it is offset from the nozzle. I think G26 checks the inset but doesn't respect it so it tries to print outside the inset even though it is designed to print at each probe point and not outside of it. I never brought this up with Roxy_3D since I designed my own mesh validation print that only prints a circle at each probe point.
     
    Geof likes this.
  8. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    424
    Likes Received:
    111
    Just to be 100% sure, which files did you start with? The one Waldo posted in post #50 above?




    Sent from my iPad using Tapatalk Pro
     
  9. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    Yes I think so.
     
  10. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    Did you post this mesh validation print here in the forum?
     
  11. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    424
    Likes Received:
    111
    Looks like in post #76




    Sent from my iPad using Tapatalk Pro
     
  12. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    Just found it, never mind.
     
  13. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    Decided to stop using G26 and use a calibration print similar to the 'Dots' one by @WheresWaldo. I had to make a different one because I'm using a 6x6 mesh instead of a 5x5. I should've done this a long time ago; it will make my adjustments a lot easier and should get mesh calibration done in a fraction of the time it takes me now.
     
  14. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    @WheresWaldo, could I change a couple of lines in the Configuration.h file to alleviate this problem? Specifically, where it defines the print bed size. Just under that, the X_MAX_POS (and Y_MAX_POS) is set to X_BED_SIZE. The bed size set in this file is 196 x 196 mm. However, I thought the bed size is 203 x 203 mm. I'm just thinking that if I can change a few of these lines, it might aaleviate the problem. Or, maybe I should just go back to a 5x5 mesh. Not sure if you have this problem.
     
  15. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    112
    Actually, it looks like the problem is solved just by using an STL instead of G26 for the test print. I just made corrections based off of my first test print (with my STL) and I'm reprinting it now. The 'dots' at X = 195, and Y = 195 are near perfect. No problems so far. Honestly, I'm good with that. It's a simple solution with many benefits and only one drawback; it takes longer to print than G26.

    But, unlike G26, I don't have to scrape the plastic off the bed for 15 minutes; the dots come off easily. That was one of the biggest headaches for me.
     
    supercazzola likes this.
  16. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    The bed is not 203 x 203, it is actually smaller, Robo by default uses 196 x 196, my printer can do 198 x 198 but I compromised when I posted my code at 197 x 197. That is not the issue with G26. Mesh size isn't the issue either, it is the fact that the mesh is inset and G26 appears to ignore the inset. It has to be inset otherwise the probe points can be off the bed at the back and off the bed on the right side. Remember the IR sensor is behind and to the right of the nozzle.
     
  17. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,757
    Likes Received:
    2,339
    :O 197! I'm 196 square! lol. Its funny to see manufacturing variance showing up in build plates. Can regain some possibly if you can move the gantry to use smaller spacers, dont know what it would be worth it :D
     
    WheresWaldo likes this.
  18. drbanks

    drbanks Active Member

    Joined:
    Dec 29, 2017
    Messages:
    141
    Likes Received:
    40
    I believed Robo's claim of 203x203, and the first time I printed something 200 square, the print head ended up banging up against the limit on one side, resulting in a very unpleasant layer shift above that.

    Not my favorite way of discovering that they fibbed.
     
  19. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @drbanks this was reported to Robo right away and corrected in firmware updates from them, where they changed the defaults to 196. I went and actually measured the moves myself, started at X0, Y0 then moved incrementally until I hit the physical limit I could go 198, but 199 banged into the side. I am not sure every printer can move 198 so that is why I settled on 197. I don't remember the timeframe exactly so I cannot say with 100% certainty whose firmware had the correct bed sizing first, mine or theirs.
     
  20. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    424
    Likes Received:
    111
    *** Edited *** to include missing steps as I do it

    I think this is how I did it, step by step:

    1. I either compile or just use the hex file from Waldo's repository, and get the R2 with the UBL enabled version - please note that in this version, the home position of the bed is where the bed just starts to trigger the IR (at the top of the R2, and not the bottom, like in the stock firmware). (When I compiled it, I left the Baud Rate at 250000, and made sure to set this in the Connection section of the printer. I first Disconnected, then checked the "Save connection Settings" box, and then selected the Baudrate 250000 from the drop down list, then clicked Connect)
    2. Then I clear the EEPROM with M502
    3. then write the defaults to EEPROM using M500
    4. i can then preheat the bed (and hotend) using
      M140 S60 (and
      M104 S190)
    5. Issue home command G28
    6. move the nozzle to close to the middle of the print bed. I issue three commands but they could easily be one: G1 X100 Y 100 Z0 to also bring bed up until IR sensor triggers
    7. using Z- on motor control screen, and using a combination of 1mm and .1mm increments, calculate the the z-offset, using a .004 inch or .102mm feeler gauge.
    8. use M206 to see what the value of Z offset it is at. you should expect to see the z-offset you calculated above
    9. set the calculated z-offset using M206 Zn.nn (where n.nn is the absolute value offset you measured). You should now see the value of Z be zero (since you set the offset)
    10. save that z home offset into memory using M500
    11. Then display the values read from EEPROM using M501, and verify that the value for Z in Home offset is what you set above
    12. issue the G28 command to home the unit
    13. issue G1 Z0
    14. G29 P1 T to start the auto probe
    15. G29 T to view the compensation grid
    16. G29 S1 store the mesh in slot 1
    17. G29 A to activate UBL
    18. M500 to store z-offset and UBL data into EEPROM
    19. displayed the values in EEPROM using M501 again
    20. G28 to come the bed again
    21. // --- NEXT STEPS NOT VALIDATED YET ---
    22. run a G26 command
    23. in Octoprint, edit the After Connection to Printer is Established gcode script to read:
      Code:
      M400 ; clear commands in command buffer
      G28 : home all axes
      G29 L1 ; load UBL mesh from slot 1 (the number is the slot you save the mesh in)
      G29 A ; activate UBL
    24. in Octoprint, edit the After Print Job Completes gcode script:
      Code:
      M104 S0 ; turn off heaters
      M140 S0 ; turn off heaters
      M107 ; turn off fans
      G91 ; set relative mode
      G1 Z50 ; move bed down 50 mm
      G90 ; set absolute mode
      G28 X0 Y0 ; home XY axes only
      G92 E0 ; zero extruder
      M84 ; turn off motors
      M355 S1 P001 ; set lights to off
    25. in Octoprint, edit the After Print Job is Canceled gcode script:
      Code:
      M104 S0 ; turn off heaters
      M140 S0 ; turn off heaters
      M107 ; turn off fans
      G91 ; set relative mode
      G1 Z50 ; move bed down 50 mm
      G90 ; set absolute mode
      G28 X0 Y0 ; home XY axes only
      G92 E0 ; zero extruder
      M84 ; turn off motors
      M355 S1 P001 ; set lights to off
     
    #120 supercazzola, May 4, 2018
    Last edited: May 7, 2018

Share This Page