New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.1.x] Make G26 work with other meshes too #8522
Conversation
If this needs a rebase so it applies to the current
Or, if you'd like to get some rebase practice…
|
No... I'm in over my head... I'll try to give you contributor rights to my fork so you can push things there. |
Be sure to remove your personal customizations from that file. |
I don't need any extra rights to push to |
I will.... But let's get everything up to snuff first. And then I'll make a pass and get all of the Configuration.h files changed to what ever format they are going to be in. The reason I didn't do any of them is because the G26 stuff got moved outside of the Auto Bed Leveling #ifdef's. It is kind of by itself. But short of duplicating those options in three areas, it kind of had to be that way. Once I know we have agreement on where it is... I can proceed with getting the Configuration.h files correct. #endif // BED_LEVELING
/**
* Enable the G26 Mesh Validation Pattern tool.
* Requires AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING
*/
#define UBL_G26_MESH_VALIDATION // Enable G26 mesh validation
#if ENABLED(UBL_G26_MESH_VALIDATION)
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool.
#define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool.
#define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool.
#endif |
The rebase resulted in no conflicts. If I push the rebased branch to your fork, you will not be able to use Github Desktop's fetch/sync button until after you've fetched the new copy of the branch. The simplest way to update your local copy is: git checkout bugfix-1.1.x ;# The branch we're working on
git fetch origin ;# All changes from remote fork
git reset --hard origin/bugfix-1.1.x ;# Move to the latest commit |
Go ahead and push the changes... I'll try those three lines. If they don't work, I can just use the web pages to edit things. But I don't understand these Travis errors. I only have the Z_Servo probe defined. And same goes for the only one bed leveling system is allowed to be defined.
|
Travis enables various options for testing. If you already have options set, then Travis will end up testing whatever you've set plus whatever it enables for testing. This is why you should never edit the default configurations when submitting PRs. If you want to have Travis CI test only the single configuration that you've edited, you can edit Travis CI and remove everything after the first You can of course make a copy of the branch, push it up to your own fork, and then visit your fork's Commits Page to see the Travis CI results there. |
Oh!!!! OK... |
Marlin/ultralcd.cpp
Outdated
@@ -57,6 +57,10 @@ | |||
extern void mesh_probing_done(); | |||
#endif | |||
|
|||
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(UBL_G26_MESH_VALIDATION) | |||
bool has_control_of_lcd_panel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the name was predicated on having ubl.
in front of it, a better new name for this flag might be lcd_under_external_control
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed... We don't have to do it now. But it should probably be in a more 'neutral' place and not in G26 then.
Marlin/ubl.h
Outdated
@@ -189,7 +142,7 @@ | |||
MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST) | |||
}; | |||
|
|||
static bool g26_debug_flag, has_control_of_lcd_panel; | |||
static bool has_control_of_lcd_panel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's now being defined as a global in ultralcd.cpp
— just remove this.
Marlin/ubl.cpp
Outdated
@@ -70,8 +60,7 @@ | |||
constexpr float unified_bed_leveling::_mesh_index_to_xpos[16], | |||
unified_bed_leveling::_mesh_index_to_ypos[16]; | |||
|
|||
bool unified_bed_leveling::g26_debug_flag = false, | |||
unified_bed_leveling::has_control_of_lcd_panel = false; | |||
bool unified_bed_leveling::has_control_of_lcd_panel = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being moved to ultralcd.cpp
as a global? Then remove this here.
Marlin/Marlin_main.cpp
Outdated
@@ -7567,12 +7567,13 @@ inline void gcode_M42() { | |||
|
|||
#endif // Z_MIN_PROBE_REPEATABILITY_TEST | |||
|
|||
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(UBL_G26_MESH_VALIDATION) | |||
#if ENABLED(UBL_G26_MESH_VALIDATION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will just be called G26_MESH_VALIDATION
after this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... Agreed...
For this failing test, Travis is enabling
|
To speed up Travis CI and skip all extra tests, removed everything after the base config test. Safe to fetch and merge from |
Marlin/ubl_motion.cpp
Outdated
#if ENABLED(UBL_G26_MESH_VALIDATION) | ||
extern bool g26_debug_flag; | ||
#else | ||
bool g26_debug_flag=false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr bool g26_debug_flag = false;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UBL_motion.cpp file still uses g26_debug_flag to spit out extra information about the mesh cells and where the nozzle is passing. So in a sense, it is still slightly UBL related. That is why it needs a place to be defined even if G26 is turned off.
This is a temporary work around... Maybe it should be called detailed_movement_debug_flag, or something like that. That would make it more natural to find a home for it. And maybe leverage in other movement functions...
|
It maybe we should add a sanity check that G26 can't be turned on without 1 of the 3 Mesh systems turned on??? That would eliminate the nested #if's. One strange thing I noticed is I could not do a single line #if ENABLED(UBL_G26_MESH_VALIDATION) && (ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
Should I go ahead and get the example Configuration.h files in this format? |
It's not needed, because the #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL)
// Gradually reduce leveling correction until a set height is reached,
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
#define ENABLE_LEVELING_FADE_HEIGHT
/**
* Enable the G26 Mesh Validation Pattern tool.
*/
//#define G26_MESH_VALIDATION // Enable G26 mesh validation
#if ENABLED(G26_MESH_VALIDATION)
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool.
#define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool.
#define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool.
#endif
#endif |
Can you explain why the one line #if doesn't work? #if ENABLED(UBL_G26_MESH_VALIDATION) && (ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) (It always fails... Even with G26 turned on and any of the bed leveling systems active.) |
If options are set up with encompassing conditions in the configurations, and sanity check is done to ensure that options aren't enabled without the things they depend on, then the rest of the code can simply refer to the one condition. So… #if ENABLED(UBL_G26_MESH_VALIDATION) …is all you need. |
Yes... But originally... Instead of two nested #if's I tried that single line #if. It never worked. And it sure seems like it should have. |
It definitely should've. Try it again and see. BTW, the conditionals file defines a shorthand for use anywhere. #define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) \
|| ENABLED(AUTO_BED_LEVELING_UBL) \
|| ENABLED(MESH_BED_LEVELING)) So… #if !HAS_MESH && ENABLED(G26_MESH_LEVELING)
#error "No!"
#endif |
Should we also resolve this duplication prior to merge?
When you merge... I'll start a Pull Request for v2.0.0 with identical changes... |
Totally. |
Both Marlin_main.cpp and G26_Mesh_Validation_Tool.cpp need those definitions. The problem is, those lines are not really enough to justify a whole new file. It isn't obvious to me where the lines should end up. One answer might be to define _GET_MESH_X() and _GET_MESH_Y() in each bed leveling system's .h file. The problem with doing that is Bi-Linear doesn't have a .h file. Maybe that is the answer? Maybe Bi-Linear should have a small .h file for its stuff? If so, then it becomes obvious how to eliminate the redundancy. |
For 1.1.x (for now, anyway) they should just go into The 2.0 branch moves those to a main |
OK. I'll wait until that happens to start making the bugfix-v2.0.0 Pull Request. At that point it should be a lot more straight forward to do the v2.0.0 Pull Request. UPDATE: Those magic 3 git lines worked. I was going to move the _GET_MESH_X() and _GET_MESH_Y() lines to Marlin.h but it looks like that has already been done. Are we ready to merge? As it turns out, there is already some 'testing' of these changes at #8513 (comment) Those are pictures of somebody with Bi-Linear using the G26 tool to figure out why he is getting bad adhesion along the edges and corners.... So... The basic functionality is working with Bi-Linear now. |
Great! You can use them again to fetch the latest changes and bring your working copy up to date. I think this PR is pretty solid at this point, and probably ready to merge. git checkout bugfix-1.1.x ;# This branch's working copy
git fetch origin ;# Get @th's changes from github
git reset --hard origin/bugfix-1.1.x ;# Point working copy at now I also went through the process of putting together |
Example Configuration.h files are not updated yet. You need to cross your settings over to the default Configuration.h file in the \Marlin directory. (UBL_G26_MESH_VALIDATION enablement has moved to a new location in the file.)
My fork is already Rebased now. Shouldn't GitHub Desktop Sync work now? |
If you do another of those git fetch-and-reset command-line operations, then you'll be caught up. But I'm patching and squashing as I go, until it passes Travis, so you may want to wait a little longer. |
Merged, haha! So I guess now you can… git checkout bugfix-1.1.x ;# This branch's working copy
git fetch MarlinFirmware ;# Get the newest bugfix from main fork
git reset --hard MarlinFirmware/bugfix-1.1.x ;# Point working copy at now
git push -f origin ;# Update your fork on github |
Example Configuration.h files are not updated yet. You need to cross
your settings over to the default Configuration.h file in the \Marlin
directory. (UBL_G26_MESH_VALIDATION enablement has moved to a new
location in the file.)
Most of the changes involved pulling the G26 stuff out of the UBL class so it was available under other bed leveling systems. (For example, the G26 variables and support functions that set, test and clear flags in large bit maps.)
I'm hoping we can use this new functionality to resolve: #8513
@thinkyhead I'll wait to merge so you can warm over what ever needs to be changed. Once we get this Pull Request into conformance, I'll do a similar one for bugfix-v2.0.0.