G32 works but drives outside bed bounds and crashes

edited July 2019 in Repetier-Firmware
So I finally got sick of manually levelling my bed with a screwdriver and bought an IR sensor. It works super well and was extremely easy to install because I already have an E3Dv6 hotend that it was designed for. After a couple of hours of struggling through extremely poor documentation I thought I had understood everything. I set up my slicer start code to this:

G28 ;home all axes
G92 E0 ;I don't remember what this is for
G1 Z30 F750 ;lower gently closer to bed to avoid horrible-sounding resonance from z-axis higher up
G32 ;auto-level
G1 X0 Y75 Z50 F1000 ;lift nozzle in preparation for extruding
G1 E20 F120 ;extrude 20mm of filament (which I trim off manually with pliers before the print starts)
G92 E0
G4 P3000

...and hit print. All going well, but the print started too close to the bed and the filament was getting squished completely flat. I actually have no idea why that happened (it seems to be printing at z=0 for some reason?) but that's not the main issue today. Since I had to cancel the print anyway I decided to try again but with the probe points further out, closer to the edges of the bed for better accuracy. I originally had the 3rd probe point at x=74, y=143 (maximum Y length is 173mm, so it was measuring 30mm in from the end of the bed) but I thought I should probably get it a bit closer, so I changed it to x=74, y=163 (which should probe 10mm from the end of the print area). That worked fine.... until the G32 completed and it randomly tried to drive way off the end of the bed and crashed it.

So... wtf? Why did it ignore the software endstops? Why did it even try to move after completing G32? I don't understand why it tries to move 30mm forwards at the end of a G32 at all, let alone why it overrides the software endstops and crashes the bed. I also can't figure out if the probe points (i.e. Z_PROBE_X1, Z_PROBE_Y1, etc.) are supposed to indicate the position of the probe when probing, or the position of the extruder when probing. It doesn't say. I would assume it means the probe position, but then when I start a G32 it first moves the extruder to what looks like y=60..... so..... again, wtf? The probe is already at y=30 and you KNOW the probe is 30mm ahead of the extruder so WHY are you moving another 30mm?? I just don't understand :'(

My X and Y limits are 147mm and 173mm respectively. My probe sits ~30mm in front of the extruder (so 30mm ahead of the extruder, in the Y+ direction; in other words, with the extruder at y=0, the probe would be roughly y=30). I'm on version 0.92.9. This my z-probe config:

// #################### Z-Probing #####################

#define Z_PROBE_Z_OFFSET 0
#define Z_PROBE_Z_OFFSET_MODE 0
#define UI_BED_COATING 1
#define FEATURE_Z_PROBE 1
#define Z_PROBE_BED_DISTANCE 5
#define Z_PROBE_PIN ORIG_Z_MIN_PIN
#define Z_PROBE_PULLUP 0
#define Z_PROBE_ON_HIGH 1
#define Z_PROBE_X_OFFSET 0
#define Z_PROBE_Y_OFFSET 30
#define Z_PROBE_WAIT_BEFORE_TEST 0
#define Z_PROBE_SPEED 2
#define Z_PROBE_XY_SPEED 150
#define Z_PROBE_SWITCHING_DISTANCE 0.5
#define Z_PROBE_REPETITIONS 2
#define Z_PROBE_HEIGHT 1.20
#define Z_PROBE_START_SCRIPT ""
#define Z_PROBE_FINISHED_SCRIPT ""
#define Z_PROBE_REQUIRES_HEATING 0
#define Z_PROBE_MIN_TEMPERATURE 150
#define FEATURE_AUTOLEVEL 1
#define Z_PROBE_X1 10   //10 from left, facing electronics
#define Z_PROBE_Y1 30   //30 from back, facing electronics
#define Z_PROBE_X2 137  //10 from 147 max right, facing electronics
#define Z_PROBE_Y2 30   //30 from back, facing electronics
#define Z_PROBE_X3 74   //half of 147 max right, facing electronics
#define Z_PROBE_Y3 163  //10 from 173 max forward, facing electronics - CRASHES BED INTO PHYSICAL MAXIMUM Y+ WTF
#define BED_LEVELING_METHOD 0
#define BED_CORRECTION_METHOD 0
#define BED_LEVELING_GRID_SIZE 5
#define BED_LEVELING_REPETITIONS 5
#define BED_MOTOR_1_X 0
#define BED_MOTOR_1_Y 0
#define BED_MOTOR_2_X 200
#define BED_MOTOR_2_Y 0
#define BED_MOTOR_3_X 100
#define BED_MOTOR_3_Y 200
#define BENDING_CORRECTION_A 0
#define BENDING_CORRECTION_B 0
#define BENDING_CORRECTION_C 0
#define FEATURE_AXISCOMP 0
#define AXISCOMP_TANXY 0
#define AXISCOMP_TANYZ 0
#define AXISCOMP_TANXZ 0

Help!

Comments

  • If distance to bed is too close increase z probe height in eeprom. That increases the distance.

    Your points do describe a parallelogram. If you see the image in config tool you see it. P1 is origin, P2 spans one edge P1-P2 and P3 the second edge P1-P3. So forth point is P2+P3-2*P1.
    Set P3 to X10, Y163 and you get a rectangle with x 10..137 and y 30..163.

    Coordinates are where extruder would be during extruding. You might already have noticed that z probe offset is applied to move z probe to the point so you need the offsets to not crash into end stops. They are in deed not active if you do not have set ALWAYS_CHECK_ENDSTOPS and that is often good to prevent false signals during print.
  • edited July 2019
    "If distance to bed is too close increase z probe height in eeprom. That increases the distance."

    Yes, that was my plan for later on when I get to stop running outside the bounds.

    "If you see the image in config tool you see it. P1 is origin, P2 spans one edge P1-P2 and P3 the second edge P1-P3. So forth point is P2+P3-2*P1."

    I wasn't aware you had to have the points exactly as it shows in the config tool. I assumed it was smarter than that and simply drew a rectangle that's parallel to the printer frame regardless of where the points are (so long as they're not in a line, obviously). I later discovered this not to be true when I tried switching to BED_LEVELING_METHOD 1 to test, and it started measuring in some weird diagonal pattern. After matching my probe points to what it shows in the config tool it measured everything correctly.

    "Coordinates are where extruder would be during extruding."

    Ok, thanks. Still not sure how that works out in practice (will need to think about it some more) but at least that should be a start.

    "They are in deed not active if you do not have set ALWAYS_CHECK_ENDSTOPS and that is often good to prevent false signals during print."

    But that's just it! ALWAYS_CHECK_ENDSTOPS is on! It's always been on and I don't get false triggers. That's why I'm so confused that it was able to crash the bed by going way outside the software endstops. Do the software endstops not trigger for things like this?

    ----------------------------------

    But whatever, I'm mostly struggling with understanding the probe offsets. If my probe is 30mm in front of the extruder (in Y+ direction), I should set Z_PROBE_Y_OFFSET to 30, yes? Not -30?

    And if, after homing, my extruder/nozzle is at X0 Y0 and my first probe point is X10 Y30, and I do G32, why does the extruder move in the Y axis? It shouldn't move at all. I'm telling it to probe at Y30, and the probe is already at Y30 (because it's 30mm in front of the extruder, and the extruder is at Y0). So why does it move? This is where I'm confused.

    And unfortunately even after doing a G32 with BED_LEVELING_METHOD 1 and checking the heights above the bed at all four corners I found it to vary as much as 0.2mm, which is too much :( Maybe I need to do distortion correction? Or maybe it's just because I had the Z_PROBE_Y_OFFSET set to 0 to try to avoid crashing the bed.

    Thanks for your help! It's greatly appreciated.
  • OH! I just realised what's happening! Argh I'm dumb. At the start of the G32 it's TRYING to move the probe over the current extruder position, but since I'm attempting to probe at Y10 when Z_PROBE_Y_OFFSET is 30, it tries to move the extruder to Y-20, which hits the mechanical endstop. It happens so fast I never saw it, and the motors are making enough noise I never heard the click. After that obviously everything is screwed up. No wonder the software endstops didn't work!

    Thanks for your help! I think I've got it figured out now.

    (For anyone else coming here in the future, there's more documentation in BedLeveling.cpp. It was only by chance that I saw that, and it was extremely helpful to figure this problem out.)
  • edited July 2019
    Hmm actually, even after changing to these settings:

    #define Z_PROBE_Z_OFFSET 0
    #define Z_PROBE_Z_OFFSET_MODE 0
    #define UI_BED_COATING 1
    #define FEATURE_Z_PROBE 1
    #define Z_PROBE_BED_DISTANCE 3
    #define Z_PROBE_PIN ORIG_Z_MIN_PIN
    #define Z_PROBE_PULLUP 0
    #define Z_PROBE_ON_HIGH 1
    #define Z_PROBE_X_OFFSET 0
    #define Z_PROBE_Y_OFFSET 30
    #define Z_PROBE_WAIT_BEFORE_TEST 0
    #define Z_PROBE_SPEED 2
    #define Z_PROBE_XY_SPEED 150
    #define Z_PROBE_SWITCHING_DISTANCE 0.5
    #define Z_PROBE_REPETITIONS 2
    #define Z_PROBE_HEIGHT 1.20 //started at 2mm, after home then g32 then move nozzle down to bed paper-level, was .75mm from 0, then remove an additional 0.05 to reduce first layer squishing
    #define Z_PROBE_START_SCRIPT ""
    #define Z_PROBE_FINISHED_SCRIPT ""
    #define Z_PROBE_REQUIRES_HEATING 0
    #define Z_PROBE_MIN_TEMPERATURE 150
    #define FEATURE_AUTOLEVEL 1
    #define Z_PROBE_X1 10   //10 from left, facing electronics
    #define Z_PROBE_Y1 35   //35 from back, facing electronics
    #define Z_PROBE_X2 137  //10 from 147 max right, facing electronics
    #define Z_PROBE_Y2 35   //35 from back, facing electronics
    #define Z_PROBE_X3 10   //10 from 147 max right, facing electronics
    #define Z_PROBE_Y3 147  //10 from 157 max forward, facing electronics
    #define BED_LEVELING_METHOD 0

    It still tries to move into the y-min endstop. I don't know why. I home all axes then do G32. It moves down close to the bed then the Y axis tries to move <0 and hits the endstop. I don't know if it's intentional, like if it's a weird sort of homing even though I already homed? But it hits the endstop then moves the other direction. If the first probe position is Y35 and Z_PROBE_Y_OFFSET is 30, why would it need to move towards Y0 at all? It should already know it's at Y0 and simply move to Y5, which will put the probe at Y35.

    OH WAIT. I think I see what it's doing! It's moving the extruder to the probe offset BEFORE moving the probe to the first probe position. Ok. So I need to move the extruder to at least Y30 before doing G32. Makes sense!
  • Ok, now that it seems to be measuring everything correctly I'm checking the heights above the bed at various points. At X20 Y20 a piece of paper moves freely even when moving down to Z0, but at X127 (20mm from right side) Y20 a piece of paper gets jammed at Z0.4 (I think that was the value). How can it be failing to autolevel so badly? It's a very flat glass print bed with BuildTak on top, measured with an IR sensor. What am I doing wrong? Perhaps I need to manually verify that the probe measurements are correct...

    19:37:29.535 : Z-probe:3.36 X:10.00 Y:30.00
    19:37:34.028 : Z-probe:4.22 X:137.00 Y:30.00
    19:37:38.682 : Z-probe:3.67 X:10.00 Y:147.00
    19:37:39.931 : plane: a = 0.0068 b = 0.0026 c = 3.2106
    19:37:39.939 : Transformation matrix: 0.999977 0.000000 -0.006771 -0.000018 0.999997 -0.002639 0.006771 0.002639 0.999974

    // #################### Z-Probing #####################

    #define Z_PROBE_Z_OFFSET 0
    #define Z_PROBE_Z_OFFSET_MODE 0
    #define UI_BED_COATING 1
    #define FEATURE_Z_PROBE 1
    #define Z_PROBE_BED_DISTANCE 3
    #define Z_PROBE_PIN ORIG_Z_MIN_PIN
    #define Z_PROBE_PULLUP 0
    #define Z_PROBE_ON_HIGH 1
    #define Z_PROBE_X_OFFSET 0
    #define Z_PROBE_Y_OFFSET 30
    #define Z_PROBE_WAIT_BEFORE_TEST 0
    #define Z_PROBE_SPEED 2
    #define Z_PROBE_XY_SPEED 150
    #define Z_PROBE_SWITCHING_DISTANCE 0.5
    #define Z_PROBE_REPETITIONS 2
    #define Z_PROBE_HEIGHT 1.20 //started at 2mm, after home then g32 then move nozzle down to bed paper-level, was .75mm from 0, then remove an additional 0.05 to reduce first layer squishing
    #define Z_PROBE_START_SCRIPT ""
    #define Z_PROBE_FINISHED_SCRIPT ""
    #define Z_PROBE_REQUIRES_HEATING 0
    #define Z_PROBE_MIN_TEMPERATURE 150
    #define FEATURE_AUTOLEVEL 1
    #define Z_PROBE_X1 10   //10 from left, facing electronics
    #define Z_PROBE_Y1 30   //30 from back, facing electronics
    #define Z_PROBE_X2 137  //10 from 147 max right, facing electronics
    #define Z_PROBE_Y2 30   //30 from back, facing electronics
    #define Z_PROBE_X3 10   //10 from 147 max right, facing electronics
    #define Z_PROBE_Y3 147  //10 from 157 max forward, facing electronics
    #define BED_LEVELING_METHOD 0
  • Do you have 3 or 4 mounting points for bed. If you have 4 it is statically undefined and might bend the bed surface. Best level first then with 4th screw loose. Run also some tests with G30 over surface or use in repetier-host the bed height map to see if it is plain. Then fix 4th screw without changing bed height at that screw for increased stability. That way you should not get any bending from 4th screw.

    If you only measure 3 points you should be able to go to these points and run G30 at them to verify height. These are the only one which must match and return same distance. Software assumes then a plane through these 3 points.

    Tip: You seem to have nearly 1mm error. Try leveling hardware wise to come much close. Not neessarily to help autoleveling but to reduce wear and reduce the required action of z axis during xy moves.
  • edited July 2019
    It's 4 mounting points. That's a good point (no pun intended). I didn't think about the fact that 4 mounting points could result in a bend. It's mounted on springs, which should help reduce that, but I'll definitely try what you suggest.

    I was also surprised to see the nearly 1mm error. I've been printing without auto-levelling so I don't know how it could be so far out of level. I'll check it.

    Thank you for your help! I definitely wouldn't have gotten this far without it :)
  • edited July 2019
    Eventually I figured out that the biggest issue was having the fluorescent light turned on above the printer. I was watching it do a G33 (distortion correction measuring, for any confused future readers) and wishing there was a little more light over the other side of the printer when I realised I'm using an IR sensor and the uneven fluro light was probably messing with it. Turned off the light, disabled distortion correction, ran G32 (bed level measure) and lo and behold the nozzle now goes down to exactly the same height at all 3 positions. The third unsupported corner is a little lower but that's just a mechanical issue with the bed :tongue:

    So lesson learned. IR probes like mine can be super accurate and work super frickin well with a BuildTak build surface, but don't like fluorescent lighting.

    Now to figure out how to make mechanical levelling easier and not require a screwdriver and pliers.... :tongue:
Sign In or Register to comment.