G32 works but drives outside bed bounds and crashes
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 #####################
...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
Comments
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.
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.
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.)
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!
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.
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
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....