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!

    21 vote(s)
    95.5%
  2. Not really.

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

    1 vote(s)
    4.5%
  1. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Robo uses a version of Marlin that is a few revisions back. Do not be mislead by their numbering system. Robo's current 1.1.8 version is actually just modifications to 1.1.0 RC6. The current release of Marlin is 1.1.6 and includes a lot of updates to the Unified Bed Leveling code. I think it would be of benefit to my use of the R2. I think others would benefit also. I started working on this but it is a lot of work undoing a lot of the code that Robo appears to have changed (my own opinion, with little to no value toward reliability or performance). So I am attempting to undo all that to go with a plain, modified only where required by the hardware version of the current Marlin release. If you are interested in this too please vote. If you want to help with testing, I can make sure you know how to upgrade the firmware and downgrade back to the Robo release.

    Current version of source and flashable .hex file:
     
    #1 WheresWaldo, Sep 8, 2017
    Last edited: Feb 9, 2018
    Shattered and sgomes like this.
  2. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,581
    Likes Received:
    2,269
    I vote of course...because lets get real why not! Super awesome of you to always put in the work.
     
  3. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    It lives!

    [​IMG]

    With a few warnings but no errors, had to change a few constructs that 1.1.0 uses that 1.1.5 changed, I haven't tested it yet but it does compile.
     
    Shattered and Geof like this.
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,302
    Likes Received:
    7,024
    Yay! If you survive a few days with no flames Imma going there :)
     
  5. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    I got rid of all the errors. It compiles with most of the Robo defaults. With a couple of edits It should work on both the C2 as well as the R2.

    I can post the files now if people understand that it is a work in progress and may not work as expected. The Marlin firmware should have no effect on the rest of the RoboOS, they are completely independent parts of the electronics.
     
    Shattered and mark tomlinson like this.
  6. Ed Ferguson

    Ed Ferguson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    272
    Likes Received:
    220
    I'm willing to give it a try on the R2 after you feel your changes are somewhat stable. I'm assuming it generates the mesh automatically via the IR probe. Due to the removable bed and also the possibility of the bed level screws moving over time, would a new mesh get created before each print?

    As a related issue - I feel the bed leveling screws can use some improvement - the threads don't mate very well and seem to come loose with vibration.
     
  7. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Just a note:
    1. These files have only been verified to compile on Arduino 1.8.4, it compiles with no errors.
    2. It is as generic a version of Marlin as has ever existed for the Robo R2/C2.
    3. Specific changes to Configuration.h are based on the current Robo3D Marlin GITHUB.
    4. Only leveling schema activated is U.B.L. with a 5 x 5 grid.
    5. Baud rate was changed from 115200 to 250000. (not tested so may need to change it back)
    To compile into a .hex file you need to select Sketch >> Export compiled Binary. this will place the .hex file in the same sub-directory that includes all the source files. The .hex files created will be named Marlin.ino.mega.hex and Marlin.ino.with_bootloader.mega.hex. You will flash the one without the bootloader.

    For the C2 the following code changes are required to Configuration.h:

    Line 77 (cosmetic change only)
    Code:
    #define STRING_CONFIG_H_AUTHOR "(BH, C2 config)" // Who made the changes.
    
    
    Line 121
    Code:
      #define MOTHERBOARD BOARD_ROBOC2  //[robo]
    
    
    Comment out lines 354 - 356 and uncomment lines 359 - 361.
    Comment line 387

    Line 784 - 785
    Code:
    #define X_BED_SIZE 127    //[robo]
    
    #define Y_BED_SIZE 127    //[robo]
    Line 793
    Code:
    #define Z_MAX_POS 160  //[robo]
    Lines 935 - 940
    Code:
      #define UBL_PROBE_PT_1_X 10   // Probing points for 3-Point leveling of the mesh  BH
    
      #define UBL_PROBE_PT_1_Y 117    //BH
      #define UBL_PROBE_PT_2_X 10    //BH
      #define UBL_PROBE_PT_2_Y 30    //BH
      #define UBL_PROBE_PT_3_X 117    //BH
      #define UBL_PROBE_PT_3_Y 30    //BH
    Line 1056 - 1060
    Code:
    #define PREHEAT_1_TEMP_BED     0   //[robo]
    #define PREHEAT_1_FAN_SPEED     0  // Value from 0 to 255
    
    #define PREHEAT_2_TEMP_HOTEND 230  //[robo]
    #define PREHEAT_2_TEMP_BED     0   //[robo]
    No guarantee that is all of them but think I got the major ones.

    Current source code located in message
     
    #7 WheresWaldo, Sep 8, 2017
    Last edited: Sep 9, 2017
    supercazzola and sgomes like this.
  8. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    @Ed Ferguson Loctite Purple Threadlocker would fix that right up, maybe even the green would work.
    http://henkeladhesivesna.com/blog/the-difference-between-red-blue-green-and-purple-threadlockers/

    UBL doesn't work this way, you have to specifically create the MESH and then if you keep G29 in your startup code, all it will do is display the mesh. It does not autocreate itself and there should be no need to do this more than one time.

    Ideally UBL with an IR probe would be the best setup. There are a lot of people on the Marlin GITHUB that have worked with UBL and I am sure Roxy3D would be willing to provide a bit of help to get another printer on the UBL bandwagon. There is also a wiki page for UBL that explains all the options for G28 and G29.
     
    #8 WheresWaldo, Sep 8, 2017
    Last edited: Sep 8, 2017
  9. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    For people wanting to see just what Robo changed in Marlin, you can look at this version and all the changes that Robo incorporated in their version I took the time to comment with [robo] at the end of the line. They did not even document their changes so this was a line by line search through their files to see what was changed and what remained the same. Any change I made to these files that are not exactly the same as Robo's changes are commented at the end of those line with BH.
     
  10. nytcrawlr

    nytcrawlr New Member

    Joined:
    Sep 17, 2016
    Messages:
    15
    Likes Received:
    8
    Fantastic! I may flash mine this weekend and give it a go.
     
  11. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    #11 WheresWaldo, Sep 8, 2017
    Last edited: Sep 10, 2017
  12. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Found a few other things that weren't changed in the original source code. Left out the "experimental" stuff Robo included in their version.

    What was added:
    1. Unique version naming
    2. Unique UUID for this version
    3. Reverted back to proper Marlin versioning
    4. Archive of .hex file for those that just want to flash
    Z -axis will not move with this version temporarily pulled, will post new version shortly.
     
    #12 WheresWaldo, Sep 8, 2017
    Last edited: Sep 9, 2017
  13. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Okay, I am formally asking for some assistance. In an effort to make this as easy as possible I have created a repository for this version of Marlin. The repository is Public and is located here: https://github.com/WheresWaldo/Marlin-1.1.5-R2/tree/dev

    If you contribute please make all pull requests (PR) against the dev branch so I can keep the master clean.

    The current issue is that I cannot move Z axis, I believe it is an endstop issue but can't find where I have a setting that is different than Robo's version of Marlin 1.1.0. I will play with it for a bit to see if I can get it to move.
     
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,302
    Likes Received:
    7,024
    Cloned it local. If I have power long enough I'll run through it. Don't expect anything before end of next week :)
     
  15. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Okay, this was the dumbest thing I have ever seen. The current source pulls the pin assignments from pin_ROBOMB.h and for some unexplainable reason the Robo source put the Z Axis on E1 instead of on Z where it belongs and is wired. I have since fixed this on my GITHUB repository and I am currently going through the UBL Mesh creation.
     
  16. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,302
    Likes Received:
    7,024
    #define DEFAULT_AXIS_STEPS_PER_UNIT { 80.0395, 80.0395, 800.24, 145.5 } //[robo]

    That is a bit disturbing.

    At least the acceleration numbers are non-stupid.
     
  17. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Yeah, I think that is foobared Don't know why they chose those numbers it just doesn't work mathematically. I am going the change them to what they should be.
     
    mark tomlinson likes this.
  18. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Okay, I am running this firmware on the R2 but I am having a bit of trouble configuring the correct offset to get UBL to perform properly. You cannot use the Offset Wizard for some reason, it hangs after it says preparing. I need to have someone much more familiar with UBL to write up a little primer on how to get it up and running.

    Also have a question about usability; Is there a reason it homes to Z_MAX_ENDSTOP and not to the Z_MIN_ENDSTOP? I would think that homing would be so much faster if it would home with the build platform much closer to the hotend than all the way at the bottom. Y Axis I understand, because the physical end stop switch is on the back side of the printer. Not sure why Z needs that since you have the IR end stop at Z_MIN
     
  19. WheresWaldo

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

    Joined:
    Feb 18, 2015
    Messages:
    5,812
    Likes Received:
    3,536
    Current .hex file inside an archive file. Extract from archive after downloading to use.
     

    Attached Files:

  20. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,581
    Likes Received:
    2,269
    At a SWAG because ultimaker does it. They seem to have borrowed quite a bit of ideas from them on the build. I like the max home on UM. Makes it easier to get the build plate out vs using a script
     

Share This Page