From 4a78db29eb15d599f22c99d66cf79d1427061c64 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 25 Mar 2015 21:28:05 +0100 Subject: [PATCH 1/5] Added instructions for Mesh bed leveling --- Documentation/MeshBedLeveling.md | 76 ++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 77 insertions(+) create mode 100644 Documentation/MeshBedLeveling.md diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md new file mode 100644 index 000000000..318c0fa0d --- /dev/null +++ b/Documentation/MeshBedLeveling.md @@ -0,0 +1,76 @@ +============================================== +Instructions for configuring Mesh Bed Leveling +============================================== + +Background +---------- + +This mesh based method of leveling/compensating can compensate for an non-flat bed. There are various opinions about doing this. It was primarily written to compensate a RigidBot BIG bed (40x30cm) that was somewhat bent. + +Currently there is no automatic way to probe the bed like the Auto Bed Leveling feature. This might soon be implemented though, stay tuned. + +Theory +------ + +The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on grid square borders. During fast travel moves one can sometimes notice a de-acceleration on these borders. + +Mesh point probing can either be carried out from the display, or by issuing `G29` commands. + +The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some press though should also work. + +Configuration +------------- + +In `Configuration.h` there are two options that can be enabled. + +`MESH_BED_LEVELING` will enable mesh bed leveling.
+`MANUAL_BED_LEVELING` will add the menu option for bed leveling. + +There is also some values that can be set. + +Following four define the area to cover. Default 10mm from max bed size + +`MESH_MIN_X`
+`MESH_MAX_X`
+`MESH_MIN_Y`
+`MESH_MAX_Y` + +Following two define the number of points to probe, total number will be these two multiplied. Default is 3x3 points. Don't probe more than 7x7 points (software limited) + +`MESH_NUM_X_POINTS`
+`MESH_NUM_Y_POINTS`
+ +The following will set the Z-endstop height during probing. When initiating a bed leveling probing a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm + +`MESH_HOME_SEARCH_Z` + +The probed points will also be saved in the EEPROM if it has been enables. Otherwise a new probe sequence needs to be made next time the printer has been turned on. + +Probing the bed with the display +-------------------------------- + +If `MANUAL_BED_LEVELING` has been enabled then will a `Level bed` menu option be available in the `Prepare` menu. + +When selecting this option the printer will first do a homing, and then travel to the first probe point. There is will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. + +If the EEPROM has been enable it can be good to issue a `M500` to get these points saved. + +Issuing a `G29` will return the state of the mesh leveling. + +Probing the bed with G-codes +---------------------------- + +Probing the bed by G-codes follows the sequence much like doing it with the display. + +`G29` or `G29 S0` will return the state bed leveling. + +`G29 S1` will initiate the bed leveling, homing and traveling to the first point to probe. + +Then use your preferred Printer controller program, i.e. Printrun, to lower the hotend until it touches the bed. Using a paper to feel the distance when it gets close. + +`G29 S2` will store the point and travel to the next point until last point has been probed. + +Note +---- + +Depending how firm feel you aim for on the paper you can use the `Z offset` option in Slic3r to compensate a slight height diff. (I like the paper loose so I needed to put `-0.05` in Slic3r) \ No newline at end of file diff --git a/README.md b/README.md index 155e916f5..e674c62c6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [Auto Bed Leveling](/Documentation/BedLeveling.md) * [Filament Sensor](/Documentation/FilamentSensor.md) * [Ramps Servo Power](/Documentation/RampsServoPower.md) + * [Mesh Bed Leveling](/Documentation/MeshBedLeveling.md) ##### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin) From 92a7260fd05d7af241b23dd7eedf897ac6234cd7 Mon Sep 17 00:00:00 2001 From: Edward Patel Date: Wed, 25 Mar 2015 21:34:55 +0100 Subject: [PATCH 2/5] typos --- Documentation/MeshBedLeveling.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/MeshBedLeveling.md b/Documentation/MeshBedLeveling.md index 318c0fa0d..21eabb6b0 100644 --- a/Documentation/MeshBedLeveling.md +++ b/Documentation/MeshBedLeveling.md @@ -12,11 +12,11 @@ Currently there is no automatic way to probe the bed like the Auto Bed Leveling Theory ------ -The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on grid square borders. During fast travel moves one can sometimes notice a de-acceleration on these borders. +The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on the borders of the grid squares. During fast travel moves one can sometimes notice a de-acceleration on these borders. Mesh point probing can either be carried out from the display, or by issuing `G29` commands. -The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some press though should also work. +The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some travel though should also work. Configuration ------------- @@ -26,7 +26,7 @@ In `Configuration.h` there are two options that can be enabled. `MESH_BED_LEVELING` will enable mesh bed leveling.
`MANUAL_BED_LEVELING` will add the menu option for bed leveling. -There is also some values that can be set. +There are also some values that can be set. Following four define the area to cover. Default 10mm from max bed size @@ -40,7 +40,7 @@ Following two define the number of points to probe, total number will be these t `MESH_NUM_X_POINTS`
`MESH_NUM_Y_POINTS`
-The following will set the Z-endstop height during probing. When initiating a bed leveling probing a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm +The following will set the Z-endstop height during probing. When initiating a bed leveling probing, a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm `MESH_HOME_SEARCH_Z` @@ -51,7 +51,7 @@ Probing the bed with the display If `MANUAL_BED_LEVELING` has been enabled then will a `Level bed` menu option be available in the `Prepare` menu. -When selecting this option the printer will first do a homing, and then travel to the first probe point. There is will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. +When selecting this option the printer will first do a homing, and then travel to the first probe point. There it will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed. If the EEPROM has been enable it can be good to issue a `M500` to get these points saved. From d43d47da1430eadbaf19a4e785868deb0c7dc1f6 Mon Sep 17 00:00:00 2001 From: Victor Torre Date: Wed, 25 Mar 2015 22:05:18 +0100 Subject: [PATCH 3/5] Clean "fromsd" array is not SDSUPPORT if not have SDSUPPORT the fromsd array is not necessary --- Marlin/Marlin_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6361559b0..6130ac8f5 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -395,7 +395,9 @@ static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; static bool relative_mode = false; //Determines Absolute or Relative Coordinates static char cmdbuffer[BUFSIZE][MAX_CMD_SIZE]; +#ifdef SDSUPPORT static bool fromsd[BUFSIZE]; +#endif //!SDSUPPORT static int bufindr = 0; static int bufindw = 0; static int buflen = 0; @@ -655,10 +657,12 @@ void setup() SERIAL_ECHO(freeMemory()); SERIAL_ECHOPGM(MSG_PLANNER_BUFFER_BYTES); SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); + #ifdef SDSUPPORT for(int8_t i = 0; i < BUFSIZE; i++) { fromsd[i] = false; } + #endif //!SDSUPPORT // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) Config_RetrieveSettings(); @@ -764,8 +768,9 @@ void get_command() return; } cmdbuffer[bufindw][serial_count] = 0; //terminate string - + #ifdef SDSUPPORT fromsd[bufindw] = false; + #endif //!SDSUPPORT if(strchr(cmdbuffer[bufindw], 'N') != NULL) { strchr_pointer = strchr(cmdbuffer[bufindw], 'N'); From ebe5b87c2cd261f1d39fd440529e24a8c0850804 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 26 Mar 2015 21:18:19 +0100 Subject: [PATCH 4/5] < like in the oher compareble loops to avoid: Marlin_main.cpp:1790: warning: array subscript is above array bounds. --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6130ac8f5..084dea197 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1787,7 +1787,7 @@ inline void gcode_G28() { enable_endstops(true); - for (int i = X_AXIS; i <= NUM_AXIS; i++) destination[i] = current_position[i]; + for (int i = X_AXIS; i < NUM_AXIS; i++) destination[i] = current_position[i]; feedrate = 0.0; From 1ff6df8f9e0acd3931b7d5eb2371d2a96f34a56a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 26 Mar 2015 21:30:53 +0100 Subject: [PATCH 5/5] Avoid warnings in SanitiCheck.h /SanityCheck.h:107:53: warning: missing terminating ' character ... --- Marlin/SanityCheck.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index a8937b44b..d228bdf99 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -104,13 +104,13 @@ // Make sure probing points are reachable #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X - #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe. + #error The given LEFT_PROBE_BED_POSITION can not be reached by the probe. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X - #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe. + #error The given RIGHT_PROBE_BED_POSITION can not be reached by the probe. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y - #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe. + #error The given FRONT_PROBE_BED_POSITION can not be reached by the probe. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y - #error The given BACK_PROBE_BED_POSITION can't be reached by the probe. + #error The given BACK_PROBE_BED_POSITION can not be reached by the probe. #endif #define PROBE_SIZE_X (X_PROBE_OFFSET_FROM_EXTRUDER * (AUTO_BED_LEVELING_GRID_POINTS-1))