Close



Results 1 to 10 of 172

Hybrid View

  1. #1
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by AbuMaia View Post
    I've made some changes in case someone decides to add this code to Marlin, but not enable it:

    case 28: //G28 Home all Axis one at a time
    #ifdef ENABLE_AUTO_BED_LEVELING
    #ifndef SAVE_G29_CORRECTION_MATRIX
    plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data)
    #endif
    #endif //ENABLE_AUTO_BED_LEVELING

    #if Z_MIN_PIN == -1
    #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
    #endif
    #ifdef SAVE_G29_CORRECTION_MATRIX
    plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data)
    #endif

    This way G28's original function of erasing the matrix is retained while the code is disabled, and then switched to G29 when it is enabled.
    Yeah, I was kind of torn which way to go. Doing what you did preserves the original behavior which has merit. It might be worth a quick discussion to decide if those extra #ifdef's should be added to the first post or not. Personally... I think the correction matrix should start off at Unity and not be affected by the G28. But there is so much legacy in place now that it isn't good to change things for no reason. I decided to make the changes as minimalistic as possible (which meant not adding the extra pre-processor commands). However, with that said, nobody is going to be typing that stuff in anyway. They are going to Cut & Paste it into their source, so there isn't any extra pain involved.

    So should we alter the original post? If we do, and SAVE_G29_CORRECTION_MATRIX is not defined, everything will function the same as it used to behave.
    Last edited by Roxy; 11-01-2014 at 08:50 AM.

  2. #2
    Engineer
    Join Date
    Jul 2014
    Location
    Eastern Colorado
    Posts
    536
    Quote Originally Posted by Roxy View Post
    So should we alter the original post?
    Only if you think there's a chance this code might eventually get pulled into the fork or "official" Marlin. As it is now, if someone wants to use it, they'll copy it in as it stands. My changes were for those who wanted to add the code, but not use it. A pretty small population I'd think.

    I should have noticed the missing ;. I'm in the middle of a print right now, so I'll test how it prints out the matrix later.
    Last edited by AbuMaia; 11-01-2014 at 11:44 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •