Need help with hardware auto bed leveling



  • Hello all, I am new to this community, and have only been working with 3d printers for a year now. I have taught myself alot about marlin and getting a DIY printer up and running. I have a QU-BD Two-up that was given to me to experiment with. Let me tell you this printer is not for the faint of heart, but it has cause me to teach myself alot about printer issues and firmware tuning. I have got this printer printing very well however I have ran into an issue with Matter Controller and its setting for hardware autobed leveling. I keep getting an error on the first 2 or 3 spots it probes.


    (error: Line number is not last line number+1, Last Line: 2 during auto bed leveling) after this it the rest of the probing goes as expected. It causes the printer not to adjust the print head in the area where the error occured and when it start to print the head is to close to the bed in the area on the bed where i get the error on probing. I have use Repeitier Host and I do not get the same error during the hardware auto bed leveling G29 command and the priming loops and first layer care perfectly adjusted and print well. But with Repeitier Host I get artifacts later in the prints that I do not get in Matter Controller. I am using the Matter Controller Slicer in MC and Slic3r in Repeiter Host.

    If anyone could shed some light on this issue that would be great. I have posted my marlin code for my autobed leveling below.

    //===========================================================================
    //============================= Bed Auto Leveling ===========================
    //===========================================================================
    

    // @section bedlevel

    #define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
    #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

    #ifdef ENABLE_AUTO_BED_LEVELING

    // 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 colinear)
    // 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

    #ifdef AUTO_BED_LEVELING_GRID

    #define LEFT_PROBE_BED_POSITION 25
    #define RIGHT_PROBE_BED_POSITION 170
    #define FRONT_PROBE_BED_POSITION 10
    #define BACK_PROBE_BED_POSITION 140

    #define MIN_PROBE_EDGE 10 // The probe 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 4

    #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 25
    #define ABL_PROBE_PT_1_Y 140
    #define ABL_PROBE_PT_2_X 61
    #define ABL_PROBE_PT_2_Y 25
    #define ABL_PROBE_PT_3_X 170
    #define ABL_PROBE_PT_3_Y 25

    #endif // AUTO_BED_LEVELING_GRID

    // Offsets to the probe relative to the extruder tip (Hotend - Probe)
    // X and Y offsets must be integers
    #define X_PROBE_OFFSET_FROM_EXTRUDER 25 // Probe on: -left +right
    #define Y_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -front +behind
    #define Z_PROBE_OFFSET_FROM_EXTRUDER -20.60 // -below (always!)

    #define Z_RAISE_BEFORE_HOMING 23 // (in mm) Raise Z before homing (G28) for Probe Clearance.
    // Be sure you have this distance over your Z_MAX_POS in case

    #define XY_TRAVEL_SPEED 3000 // X and Y axis travel speed between probes, in mm/min

    #define Z_RAISE_BEFORE_PROBING 23 //How much the extruder will be raised before traveling to the first probing point.
    #define Z_RAISE_BETWEEN_PROBINGS 3 //How much the extruder will be raised when traveling from between next probing points
    #define Z_RAISE_AFTER_PROBING 0 //How much the extruder will be raised after the last probing point.

    // #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 probe.
    //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
    //#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.

    //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
    //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
    // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.

    // #define PROBE_SERVO_DEACTIVATION_DELAY 300

    //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
    //it is highly recommended you let this Z_SAFE_HOMING enabled!!!

    #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
    // When defined, it will:
    // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
    // - If stepper drivers timeout, it will need X and Y homing again before Z homing
    // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
    // - Block Z homing only when the probe is outside bed area.

    #ifdef Z_SAFE_HOMING

    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)

    #endif

    // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
    // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
    // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
    // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
    // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
    // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
    // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
    // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
    // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
    // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
    // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.

    //#define Z_PROBE_ENDSTOP

    #endif // ENABLE_AUTO_BED_LEVELING

    // @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.
    #ifdef 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

    // @section movement


  • Moderator

    Could you post your terminal log after trying to run the probing?

    Also here's a tip for the forum. When making a post, you can click the formatting button and select Code. This will make a block for you to put code in so that it will not fill up the entire page.



  • Oh sorry didn't notice I could format the post like that.

    Here is the log from MatterControl

    ->N43 G28*36
    <-Error:Line Number is not Last Line Number+1, Last Line: 43
    <-Resend: 44
    <-ok
    ->N44 M105*23
    <-ok
    <-ok T:107.6 /0.0 B:0.0 /0.0 T0:107.6 /0.0 @:0 B@:0
    ->N45 M105*22
    <-ok T:107.6 /0.0 B:0.0 /0.0 T0:107.6 /0.0 @:0 B@:0
    ->N46 M114*21
    <-X:62.00 Y:112.00 Z:20.60 E:0.00 Count X: 62.00 Y:112.01 Z:20.60
    <-ok
    ->N1 M110 N1*125
    <-ok
    ->N2 M105*37
    <-ok T:107.2 /0.0 B:0.0 /0.0 T0:107.2 /0.0 @:0 B@:0
    ->N3 G29*17
    <-G29 Auto Bed Leveling
    ->N3 G29*17
    <-Error:Line Number is not Last Line Number+1, Last Line: 3
    <-Resend: 4
    <-ok
    ->N4 M105*35
    ->N4 M105*35
    <-Error:Line Number is not Last Line Number+1, Last Line: 4
    <-Resend: 5
    <-ok
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    ->N5 M105*34
    <-Eqn coefficients: a: 0.01143527 b: 0.00209500 d: 19.41866302
    <-planeNormal x: -0.011435 y: -0.002095 z: 1.000000
    <- 
    <-
    <-Bed Level Correction Matrix:
    <-+0.999935 +0.000000 +0.011435 
    <--0.000024 +0.999998 +0.002095 
    <--0.011435 -0.002095 +0.999932 
    <-ok
    <-Error:Line Number is not Last Line Number+1, Last Line: 5<-Resend: 6
    <-ok
    ->N6 M105*33
    <-ok T:79.4 /0.0 B:39.1 /0.0 T0:79.4 /0.0 @:0 B@:0
    ->N7 M114*32
    <-ok T:79.4 /0.0 B:39.1 /0.0 T0:79.4 /0.0 @:0 B@:0
    <-ok T:79.4 /0.0 B:39.1 /0.0 T0:79.4 /0.0 @:0 B@:0
    <-X:0.23 Y:164.04 Z:19.86 E:0.00 Count X: 0.00 Y:164.00 Z:20.21
    <-ok

    Same Sequence in Repeitier Host (Error Reporting is turned on)

    21:11:36.798 : G29 Auto Bed Leveling
    21:13:17.736 : Eqn coefficients: a: 0.00981727 b: 0.00310005 d: 19.42054176
    21:13:17.740 : planeNormal x: -0.009817 y: -0.003100 z: 1.000000
    21:13:17.740 : 21:13:17.740 : Bed Level Correction Matrix:
    21:13:17.744 : +0.999952 +0.000000 +0.009817
    21:13:17.744 : -0.000030 +0.999995 +0.003100
    21:13:17.748 : -0.009817 -0.003100 +0.999947




  • in your marlin code is (#define min_software_endstops false) set to true? its above bed leveling section so cant see.


  • Moderator

    This seems like an issue with the way MatterControl is communicating with your printer. After MatterControl sends a command, it waits to receive an ok back from the printer before sending the next command. If MatterControl does not receive the ok after a certain amount of time, it tries sending the command again. Your printer is taking a long time to complete the G29 command, so MatterControl is sending it again. Normally this is fine, since the repeated command is simply ignored. The line number error you are seeing is the printer telling MatterControl that it ignored the second G29. However in your case it seems to be causing a hiccup as the printer receives the redundant command and figures out how to deal with it.

    We've opened a bug report regarding this issue. It may be some time before this can be addressed. In the mean time, I'd suggest upgrading your printer's firmware if possible. We have not seen this happening other versions of Marlin.



  • Necro thread....
    Has there been any update on this issue? I'm finding the same problem with G28 and G29 appears to be failing on first point from this.
    Currently using latest Marlin_2.0.x as at 20th Oct


Log in to reply
 

Looks like your connection to MatterHackers Community was lost, please wait while we try to reconnect.