Autolevel, homing and manual control problems
Ok, so I've got z-probe installed on Prusa i3 clone and it's working, more or less.
First problem:
Let's assume previous print ended at z = 100mm, there is no min z endstop, because probe is connected there. After power up:
G28 ; this homes X and Y (not Z, understandable - no height data)
G32 ; this also works fine
G28 ; again, now X, Y and Z are homed (correctly)
G1 Z1 F100; I believe this should cause "rise head by 1mm" so we should have Z=1mm - but instead, nozzle finishes this command at Z=101mm (position before G32 + 1mm)
Second problem, while running G32 command, after completing each sample point, head is lifted all the way up, to the original position . Seriously, what for? It takes ages to complete if nozzle was high after power up. IMHO it should move up only by Z_PROBE_BED_DISTANCE.
Third: If no min endstop is installed, it's possible to move nozzle manually below 0, is there a way to change this, so it wouldn't be possible?
Fourth: If z-probe/autolevel (G32) is started when nozzle is <= 0 (z-probe is correctly triggered), it will be grinding platform between sample points. Shouldn't active probe signal tell FV that it's dangerous to move head until it's lifted?
Fifth: Can z-probe be used as min-z-endstop for homing, before G32/29 is executed?
FV version 0.92.5, z-probe/autolevel config as follows:
#define Z_PROBE_Z_OFFSET 0.65
#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 Z_MIN_PIN
#define Z_PROBE_PULLUP 0
#define Z_PROBE_ON_HIGH 0
#define Z_PROBE_X_OFFSET 70
#define Z_PROBE_Y_OFFSET -10
#define Z_PROBE_Z_BACK_MOVE 5
#define Z_PROBE_WAIT_BEFORE_TEST 0
#define Z_PROBE_SPEED 2
#define Z_PROBE_XY_SPEED 150
#define Z_PROBE_SWITCHING_DISTANCE 2
#define Z_PROBE_REPETITIONS 2
#define Z_PROBE_HEIGHT 1.0
#define Z_PROBE_START_SCRIPT ""
#define Z_PROBE_FINISHED_SCRIPT ""
#define FEATURE_AUTOLEVEL 1
#define Z_PROBE_X1 -30
#define Z_PROBE_Y1 20
#define Z_PROBE_X2 110
#define Z_PROBE_Y2 20
#define Z_PROBE_X3 50
#define Z_PROBE_Y3 160
#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
First problem:
Let's assume previous print ended at z = 100mm, there is no min z endstop, because probe is connected there. After power up:
G28 ; this homes X and Y (not Z, understandable - no height data)
G32 ; this also works fine
G28 ; again, now X, Y and Z are homed (correctly)
G1 Z1 F100; I believe this should cause "rise head by 1mm" so we should have Z=1mm - but instead, nozzle finishes this command at Z=101mm (position before G32 + 1mm)
Second problem, while running G32 command, after completing each sample point, head is lifted all the way up, to the original position . Seriously, what for? It takes ages to complete if nozzle was high after power up. IMHO it should move up only by Z_PROBE_BED_DISTANCE.
Third: If no min endstop is installed, it's possible to move nozzle manually below 0, is there a way to change this, so it wouldn't be possible?
Fourth: If z-probe/autolevel (G32) is started when nozzle is <= 0 (z-probe is correctly triggered), it will be grinding platform between sample points. Shouldn't active probe signal tell FV that it's dangerous to move head until it's lifted?
Fifth: Can z-probe be used as min-z-endstop for homing, before G32/29 is executed?
FV version 0.92.5, z-probe/autolevel config as follows:
#define Z_PROBE_Z_OFFSET 0.65
#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 Z_MIN_PIN
#define Z_PROBE_PULLUP 0
#define Z_PROBE_ON_HIGH 0
#define Z_PROBE_X_OFFSET 70
#define Z_PROBE_Y_OFFSET -10
#define Z_PROBE_Z_BACK_MOVE 5
#define Z_PROBE_WAIT_BEFORE_TEST 0
#define Z_PROBE_SPEED 2
#define Z_PROBE_XY_SPEED 150
#define Z_PROBE_SWITCHING_DISTANCE 2
#define Z_PROBE_REPETITIONS 2
#define Z_PROBE_HEIGHT 1.0
#define Z_PROBE_START_SCRIPT ""
#define Z_PROBE_FINISHED_SCRIPT ""
#define FEATURE_AUTOLEVEL 1
#define Z_PROBE_X1 -30
#define Z_PROBE_Y1 20
#define Z_PROBE_X2 110
#define Z_PROBE_Y2 20
#define Z_PROBE_X3 50
#define Z_PROBE_Y3 160
#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
Comments
Oh I know that without endstops there is no way to tell where nozzle is after powerup, but since we have z-probe, I believe that there is a solution to this:
Sure I don't want gap between bed and extruder, but the again - we know size of this gap (Z_PROBE_Z_OFFSET), so using this info printer can establish correct coordinate boundaries.
PS.: I've found very useful code commented in Printer::runZProbe(), that optimizes how G32 works. It would be nice to have it's presence controlled by some preprocessor directive in configuration.h.
I would vote for ignoring mechanical probes all together for this function. So, few words of warning should be added to documentation/configurator (if it will be integrated). People who compile their own versions should read these anyway.
My code moves carriage up only if probe is triggered (and only by max of Z_PROBE_BED_DISTANCE * 2), so I don't believe that there is a risk of hitting top limits, unless z-probe is faulty.
As for using runZProbe(), I've initially thought that sequence of G28+G32+G28 would do the trick (it almost did), but G32 came out not to be very fast if initial Z position was high, and introduced problem with relative movement after homing - mentioned earlier. As far as I can tell, runZProbe() will try to find bed level, and then will go back to initial position - not exactly what I want to do when homing. But if You prefer to adapt runZProbe for homing, I would not object, I'm not specialist here. But I would like to have any z-homing method even without endstops on z-axis (as an option).
And one more thing, would it be possible to integrate code for ADC keypad written by axelsp into main branch? It would simplify lifes of people like me, who have these cheap chinese printers with this weird chinese solutions, and want to run them on original repetier.
And one more question, how safe is using interrupt driven keypads? I was thinking about creating yet another controller module connected via i2c, and using interrupt to signal key state changes.
I suppose I'll rewrite i2c communication code so it would be fully asynchronous and eliminate any polling on communication buses. TWI interrupt has lower priority than any of the timers, and these avrs support clock stretching, so this shouldn't interfere with timers. But will know for sure when hardware will be operational. In worst case scenario it will not work correctly, and prototypes are build to test such things.