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!

    28 vote(s)
    93.3%
  2. Not really.

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

    1 vote(s)
    3.3%
  1. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Okay, I was hoping they would chime in and kind of point me in the right direction to get started.
     
  2. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    I actually got top the point of compiling this, but I get an error stating that the pin isn't configured in arduino.h or something similar. Any help would be appreciated!
     
  3. adikted2astro

    adikted2astro Active Member

    Joined:
    Aug 10, 2017
    Messages:
    290
    Likes Received:
    110
    Here is what I sent one of the other members. I hope this will help you.

    Your welcome. Use the Arduino/Genuino Mega or Mega 2650 for your board. Send me messages if you run into problems.

    As far as UBL is concerned, the biggest problem I have had is editing the mesh points after it performs the initial UBL leveling routine. When I first did this, it took over 6 hours to get the mesh where I wanted it; editing the points manually is a pain, but it needed to be done. I'll try and explain the process because it would've been nice if someone had done this for me when I started. It could have saved me a lot of time. Make sure to set your z-offset before performing UBL.

    After performing UBL ('G29 P1'), type in a 'G29 P3' command just in case it doesn't fill them all in. Also, the mesh is displayed and stored in an I, J format. Check out the file I uploaded. 'I' corresponds to the row and 'J' is the column. My mesh has 36 points on it. It is currently displayed like this (after using the G29 T command):

    Recv: (0,5) (5,5)
    Recv: (1,195) (195,195)
    Recv: 0.004 0.032 0.047 0.165 0.167 0.174
    Recv:
    Recv: -0.205 -0.161 -0.025 0.000 -0.054 0.050
    Recv:
    Recv: -0.312 -0.225 -0.255 -0.095 -0.118 -0.144
    Recv:
    Recv: -0.251 -0.315 -0.205 -0.330 -0.206 -0.215
    Recv:
    Recv: -0.366 -0.356 -0.333 -0.319 -0.421 -0.350
    Recv:
    Recv: -0.466 -0.458 -0.413 -0.377 -0.471 -0.500
    Recv: (1,1) (195,1)
    Recv: (0,0) (5,0)

    So, the best thing to do after performing UBL is type in 'G26 BXX HYYY F1.75 L0.2 R S0.4' and hit enter. This starts a test print of your mesh. It will heat the bed up to whatever temp you define (XX) and the hotend up to YYY. F1.75 specifies the filament diameter, L0.2 specifies a layer height of 0.2 for the test print, 'R' repeats for each point (you must have this or it won't work), and S0.4 specifies a nozzle diameter of 0.4 (if you use a larger nozzle, just type in the diameter in place of 0.4). I usually use PLA temps (B60 H200).

    After the test print is done, you examine each of the points and determine if they are too high, too low, or just right. If the point is too low (layer thickness will be less than 0.2 - you might need a set of calipers to check it), then you add to that point. Say you need to add 0.100 mm to (I2,J1) = -0.333, the command would be: 'M421 I2 J1 Z-0.233'. M421 modifies a particular mesh point (I,J), and the number after Z should be what you want that height to be, NOT the correction itself. You have to add or subtract to the Z value of that mesh point. I hope I'm not making this too complicated. I apologize if I am. Another example: if (I5,J3) = -0.144 is too high and you want to take off 0.050 mm from it, type in 'M421 I5 J3 Z-0.194'. Always type in the Z value as x.xxx; use 4 digits in total.

    This is going to take some getting used to, but once you do, it's relatively simple. After you have modified all your mesh points, type in G29 S1 to save everything to your mesh in slot 1. To verify all points have been modified, type in the G29 T command again and Octoprint will display it.

    I upload a copy of the PDF I attached to my iPad, then write in the corrections for each point and input those corrections all at once. Hopefully you won't need to manually adjust this mesh. My IR sensor is garbage, so that's why it sucked for me. But, once you have your mesh right where you want it, then there's no need to do it again unless you move the printer. My prints are now picture perfect. First layers look amazing. I really haven't had any problems with my prints after doing this.

    One more thing. Don't be afraid to make large corrections if you need to. I've made corrections up to 0.200 mm, and as low as 0.020 mm. If you aren't sure about it, make a relatively small correction and then do another test print (use PLA, it works best). Like I said, it will take some getting used to. Just message me any questions.

    Correction: I = column, J = row. See the mesh grid I attached.

    UPDATE: I NO LONGER RECOMMEND USING G26 TEST PRINTS. Instead, use the STL file from @WheresWaldo on post #76, or create your own STL with similar calibration 'dots'. I built an STL file according to my 6 x 6 grid and performed UBL corrections using this. It is infinitely easier than G26! After the dots have printed, you simply measure each one with calipers and make the adjustments using M421. For instance, if your dots are supposed to be 1mm thick on a particular mesh point and you measure it at 0.89 mm, add 0.11mm to it using M421. Always do another test print after adjustements to make sure. But, using these dots, it takes a fraction of the time it would using G26, as far as measuring and making correct adjustments. Personally, my dot thickness was 1mm, but I adjusted my mesh points to 0.95 mm because I want my prints to be a little bit smooshed. It works beautifully and I only had to adjust each point 2 times, compared with at least 12 times using G26. Your mesh might be better than mine; my IR sensor is horrible.
     

    Attached Files:

    #83 adikted2astro, Mar 28, 2018
    Last edited: May 4, 2018
  4. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
    Did you pick the correct board or processor in the Arduinoi IDE?

    Tools >> Board >> Arduino / Genuino Mega or Mega 2560
    Tools >> Processor >> ATMega 2560 (Mega 2560)

    @adikted2astro beat me to it.
     
    supercazzola and JustinDS89 like this.
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    22,578
    Likes Received:
    7,230
    We need to move and pin that post :)
     
    WheresWaldo likes this.
  6. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Those instructions look like they will help greatly. I have since got this to compile and have it installed. I am stuck on setting the z-offset currently before doing the UBL though. How to I go about that since I can't use the wizard?

    Thanks for all the help!
     
  7. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Also, I think I may have the Z-Offset set using some commands I found, but the G29 P1 doesn't seem to do anything when I send it.
     
  8. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
    M206 Zn.nnn

    I do this in terminal of OctoPrint
    Code:
    M206 Z0
    G28
    then use the LCD to move down 1.0 and 0.10 until a thin piece of paper is snug between the bed and the nozzle. then do
    Code:
    M206
    look at the result and you will see the Z will be how much you actually moved the bed. Once you have the number for Z then issue, in Octoprint's terminal
    Code:
    M206 Zn.nnn
    where n.nnn is the positive offset of the negative number listed in the plain M206 command issued just prior to this. Then finally
    Code:
    M500
    which will save the results to EEPROM
     
    supercazzola and JustinDS89 like this.
  9. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
    G29 P1 R
     
    JustinDS89 likes this.
  10. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Okay so I input G29 P1 R after setting the Z-Offset, but it just sits there. I guess I don't quite get what it is suppose to be doing after that command.

    Also just to clarify. So after I get a -5.20 when setting the Z-Offset I use the command M206 Z5.20 to actually set it correct?
     
  11. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
    Yep,

    I don't think G29 works unless preceeded by a G28 first.
     
  12. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Ah okay, trying to figure out the sequence of commands to perform UBL properly.

    Thanks, I will try to look into that.
     
  13. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    G28 works, but still the G29 command doesn't seem to start auto probing the bed.

    Edit: I had to enter these commands before using G28 and G29. Hopefully this was correct.

    M502 ; Reset settings to configuration defaults...
    M500 ; ...and Save to EEPROM. Use this on a new install.
    M501 ; Read back in the saved EEPROM.
     
  14. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    After doing this should I remove the auto level start gcode in OctoPrint?
     
  15. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
  16. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    Ah okay, perfect. I forgot about seeing that before.

    Thank you all so much for the help. I think I am heading in the right direction!
     
  17. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    It appears when doing the test print that it is way up in the air. It's like the z-offset isn't actually being set beforehand or that it is being wiped out.

    Edit: Also, can you adjust the Z-Offset at any time without messing up UBL? Like let's say I change out the nozzle and need to adjust it.
     
    #97 JustinDS89, Mar 28, 2018
    Last edited: Mar 28, 2018
  18. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    It appears @WheresWaldo had this issue too, I will just print his attached STL instead of using G26.
     
  19. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,586
    Yes you can change M206 Z anytime you want. Just remember to save it after with M500 so you don't have to set it for every print.
     
    JustinDS89 likes this.
  20. JustinDS89

    JustinDS89 Member

    Joined:
    Feb 20, 2018
    Messages:
    148
    Likes Received:
    21
    I'm not sure that it has to do with this firmware or the process I went through to set this up, but I can leave the z-offset alone and the first print is a tad too far away. I reprint it just test something without making a single change and now it is too close?

    Am I doing something wrong?
     

Share This Page