MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.14k stars 19.2k forks source link

Mesh bed levelling not working anymore (RCBugFix) #4170

Closed Alex9779 closed 8 years ago

Alex9779 commented 8 years ago

I am trying to get the RCBugFix of today but I can't get it working anymore since the new probe options in the config. The problem is that after homing the bed is moved to Z=5. That is ok but when I start the mesh bed levelling the machine homes and rests at Z=5. Then I click to start and the machine does the Z hop move to the first position, undoes the Z hop but doesn't move to Z=0 instead goes back to Z=5. Z=5 is not yet 5mm away from the nozzle but about 7mm and the correct is limited to 4mm so I can't get the bed to the nozzle.

Do I have to change something in my config? ``` //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== // // Probe Type // Probes are sensors/switches that are activated / deactivated before/after use. // // Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. // You must activate one of these to use AUTO_BED_LEVELING_FEATURE below. // // Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. // // A Fix-Mounted Probe either doesn't deploy or needs manual deployment. // For example an inductive probe, or a setup that uses the nozzle to probe. // An inductive probe must be deactivated to go below // its trigger-point if hardware endstops are active. #define FIX_MOUNTED_PROBE // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // // In the following example the X and Y offsets are both positive: // #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // // +-- BACK ---+ // | | // L | (+) P | R <-- probe (20,20) // E | | I // F | (-) N (+) | G <-- nozzle (10,10) // T | | H // | (-) | T // | | // O-- FRONT --+ // (0,0) #define X_PROBE_OFFSET_FROM_EXTRUDER 14.75 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 34 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -4 // Z offset: -below +above [the nozzle] // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 // // Allen Key Probe is defined in the Delta example configurations. // // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. // With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. // // *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** // // To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. // Example: To park the head outside the bed area when homing with G28. // // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including // NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. // - Otherwise connect: // - normally-closed switches to GND and D32. // - normally-open switches to 5V and D32. // // Normally-closed switches are advised and are the default. // // The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) // Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the // default pin for all RAMPS-based boards. Some other boards map differently. // To set or change the pin for your board, edit the appropriate pins_XXXXX.h file. // // WARNING: // Setting the wrong pin may have unexpected and potentially disastrous consequences. // Use with caution and do your homework. // //#define Z_MIN_PROBE_ENDSTOP // Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. // The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // To use a probe you must enable one of the two options above! // This option disables the use of the Z_MIN_PROBE_PIN // To enable the Z probe pin but disable its use, uncomment the line below. This only affects a // Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above. // If you're using the Z MIN endstop connector for your Z probe, this has no effect. //#define DISABLE_Z_MIN_PROBE_ENDSTOP // Enable Z Probe Repeatability test to see how accurate your probe is //#define Z_MIN_PROBE_REPEATABILITY_TEST // // Probe Raise options provide clearance for the probe to deploy, stow, and travel. // #define Z_RAISE_PROBE_DEPLOY_STOW 0 // Raise to make room for the probe to deploy / stow #define Z_RAISE_BETWEEN_PROBINGS 5 // Raise between probing points. // // For M851 give a range for adjusting the Z probe offset // #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{0:'Low',1:'High'} #define X_ENABLE_ON 0 #define Y_ENABLE_ON 0 #define Z_ENABLE_ON 0 #define E_ENABLE_ON 0 // For all extruders // Disables axis stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! #define DISABLE_X false #define DISABLE_Y false #define DISABLE_Z false // Warn on display about possibly reduced accuracy //#define DISABLE_REDUCED_ACCURACY_WARNING // @section extruder #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR true #define INVERT_Y_DIR false #define INVERT_Z_DIR false // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. #define INVERT_E0_DIR true #define INVERT_E1_DIR true #define INVERT_E2_DIR false #define INVERT_E3_DIR false // @section homing #define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN // :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // @section machine // Travel limits after homing (units are in mm) #define X_MIN_POS -29.5 #define Y_MIN_POS 0 #define Z_MIN_POS 0 #define X_MAX_POS 310 #define Y_MAX_POS 250 #define Z_MAX_POS 300 //=========================================================================== //========================= Filament Runout Sensor ========================== //=========================================================================== //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out #if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = false; // set to true to invert the logic of the sensor. #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" #endif //=========================================================================== //============================ Mesh Bed Leveling ============================ //=========================================================================== #define MESH_BED_LEVELING // Enable mesh bed leveling. #if ENABLED(MESH_BED_LEVELING) #define MESH_INSET 5 // Mesh inset margin on print area #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define MESH_NUM_Y_POINTS 3 #define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0. //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest at origin [0,0,0] #define MANUAL_BED_LEVELING // Add display menu option for bed leveling. #if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis. #endif // MANUAL_BED_LEVELING #endif // MESH_BED_LEVELING //=========================================================================== //============================ Bed Auto Leveling ============================ //=========================================================================== // @section bedlevel //#define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: // // - "grid" mode // Probe several points in a rectangular grid. // You specify the rectangle and the density of sample points. // This mode is preferred because there are more measurements. // // - "3-point" mode // Probe 3 arbitrary points on the bed (that aren't collinear) // You specify the XY coordinates of all 3 points. // Enable this to sample the bed in a grid (least squares solution). // Note: this feature generates 10KB extra code size. #define AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 10 #define RIGHT_PROBE_BED_POSITION 265 #define FRONT_PROBE_BED_POSITION 15 #define BACK_PROBE_BED_POSITION 185 #define MIN_PROBE_EDGE 10 // The Z probe minimum square sides can be no smaller than this. // Set the number of grid points per dimension. // You probably don't need more than 3 (squared=9). #define AUTO_BED_LEVELING_GRID_POINTS 2 #else // !AUTO_BED_LEVELING_GRID // Arbitrary points to probe. // A simple cross-product is used to estimate the plane of the bed. #define ABL_PROBE_PT_1_X 15 #define ABL_PROBE_PT_1_Y 180 #define ABL_PROBE_PT_2_X 15 #define ABL_PROBE_PT_2_Y 20 #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 20 #endif // !AUTO_BED_LEVELING_GRID //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine. // Useful to retract a deployable Z probe. // If you've enabled AUTO_BED_LEVELING_FEATURE and are using the Z Probe for Z Homing, // it is highly recommended you also enable Z_SAFE_HOMING below! #endif // AUTO_BED_LEVELING_FEATURE // @section homing // The position of the homing switches //#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. #if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif // Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. // // With this feature enabled: // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. // - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT (14.75) // X point for Z homing when homing all axis (G28). #define Z_SAFE_HOMING_Y_POINT (34) // Y point for Z homing when homing all axis (G28). #endif ```
epatel commented 8 years ago

@Alex9779 I hear you, but I have a hard time understanding what is going on. Sry. Though, 2 things. You have Z_RAISE_BETWEEN_PROBINGS set which changes MBL in a way I am not familiar with (meaning I have not investigated how or what that does, but I think I can imagine what it is supposed to do). Then X_MIN_POS looks strange, shouldn't really matter but it looks off, but maybe your endstop is placed outside the bed like that?

Alex9779 commented 8 years ago

Z_RAISE_BETWEEN_PROBINGS is what it was set to when the setting appeared, I just changed Z_RAISE_PROBE_DEPLOY_STOWbecause my probe does not need clearance when deployed, it is fixed... X_MIN_POS is ok, my endstop is off the bed and that is the position where the nozzle is when the endstop is hit compared to 0,0 of the bed...

So you need more details?

Alex9779 commented 8 years ago

Oh BTW I think I tried to set Z_RAISE_BETWEEN_PROBINGSto 0 but without any effect on what happens, the bed rests at Z=5 after homing and the leveling sequence behaves the same...

epatel commented 8 years ago

MBL doesn't use the probe, it is more of a manual process. Nothing is deployed or stowed.

With the endstops being outside of the bed one might need to manually modify the "inset" and how that is added. Right now it is uniform front/back, left/right. But it seems for your use case a longer inset for the "left" side (same side as the X endstop) could be good.

Z behaviour sounds very strange.

epatel commented 8 years ago

Do you have a "probe" configured?

any of these enabled? FIX_MOUNTED_PROBE Z_PROBE_ALLEN_KEY HAS_Z_SERVO_ENDSTOP Z_PROBE_SLED

Alex9779 commented 8 years ago

I am using the exact position setting in adv for mesh bed leveling. The only problem I have is the Z...

Alex9779 commented 8 years ago

When the stow is set to the default value of 15 the bed moves much more down when homing... And also when doing the manual leveling sequence...

Alex9779 commented 8 years ago

I have FIX_MOUNTED_PROBE activated...

epatel commented 8 years ago

Hmmm...could be that causes G28 to go into this part

https://github.com/MarlinFirmware/Marlin/blob/RCBugFix/Marlin/Marlin_main.cpp#L2834

Which confuses MBL.

epatel commented 8 years ago

Note that MBL "calls" G28 a couple of times.

epatel commented 8 years ago

I recommend to disable the probe if that is possible. MBL is currently a manual process via the LCD (or G-codes if you lack a display) @Roxy-3D is working on adding auto-mesh probing feature, and more.

Alex9779 commented 8 years ago

Ok I am going to try that and report...

epatel commented 8 years ago

See the Probing the bed with the display part here https://github.com/epatel/Marlin/blob/75f9fb50c4002f6d4ba0345f5594cbac1fab1fa6/Documentation/MeshBedLeveling.md#probing-the-bed-with-the-display

Alex9779 commented 8 years ago

Ok I disabled FIXED_MOUNTED_PROBE and Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN. It is working again... So as I assumed it was a config problem... Thanks for clearing it up, it seems I don't need the probe settings, though the probe offset are taken into account for the safe Z homing positions. I could set them all to 0 and just set safe Z homing to where the nozzle should be, couldn't I?

epatel commented 8 years ago

Great it works again. For the other parts, I am not sure, nothing I know how it works, never used :-S

Alex9779 commented 8 years ago

Ok no problem... TYVM!

stevewatts commented 7 years ago

did you manage to get any of the auto bed-levelling working without the fixed probe? I just see "Auto Bed Leveling requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KE..........'

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.