Dev2: G30 always homes first
Hi,
I do homing for all three axis. Then I move to a position where I want to check my z-probe.
I enter G30 or G30 X35 Y100 (they give the same result)
I enter G30 or G30 X35 Y100 (they give the same result)
I expect:
- Servo turns
- probe moves down to the bed and measures the trigger position.
- servo turns back
Why I expect it:
https://www.reprap.org/wiki/G-code#G30:_Single_Z-Probe (I know, it is the description of REPRAP-firmware; I think it should be the same)
https://www.reprap.org/wiki/G-code#G30:_Single_Z-Probe (I know, it is the description of REPRAP-firmware; I think it should be the same)
What I get:
- Machine homes
- Servo turns
- machine moves the value given at "z-probe xaxis offset" (it does not move to the X35 Y100 position)
- it moves down (because this position is not allowed I reset my machine)
My config:
#define Z_PROBE_TYPE Z_PROBE_TYPE_DEFAULT //#define Z_PROBE_TYPE Z_PROBE_TYPE_NONE #define Z_PROBE_HEIGHT 3 // Distance bed-nozzle when trigger switches servo #define Z_PROBE_BED_DISTANCE 5 // Optimal starting distance #define Z_PROBE_SPEED 5 // Speed fo z testing #define Z_PROBE_X_OFFSET 0 // x offset relative to extruder 0,0 offset #define Z_PROBE_Y_OFFSET 26 // y offset relative to extruder 0,0 offset #define Z_PROBE_COATING 0 // Coating thickness if not detected by probe #define Z_PROBE_DELAY 0 // Extra delay before starting again. Only needed on electronic probes keeping state for a while #define Z_PROBE_REPETITIONS 2 // How often should we probe, 1 is minimum #define Z_PROBE_USE_MEDIAN 1 // 0 = use average, 1 = use middle value after ordering z #define Z_PROBE_SWITCHING_DISTANCE 2 // Minimum distance required to safely untrigger probe - used for faster repeated measurement #define Z_PROBE_BORDER 0 // Safety border to ensure position is allowed #define Z_PROBE_PAUSE_HEATERS 0 // Pause all heaters when probing to reduce EMI artifacts #define Z_PROBE_START_SCRIPT "M340 P0 S1200 R500" #define Z_PROBE_FINISHED_SCRIPT "M340 P0 S1900 R500" #define Z_PROBE_RUN_AFTER_EVERY_PROBE ""
and two lines which I don't understand
Comments
So you need to run a G1 X Y Z pos first and then run G30.
are not used at all. Just delete them. I think they are leftovers from V1 configuration.
I did not know that I can find the command in the main.cpp, thanks for that hint!
It is always measured and current position if allowed. I just uploaded a fix for allowed position computation. Close to borders math was wrong.
It does Z_PROBE_REPETITIONS measurements at that position and in between it goes Z_PROBE_SWITCHING_DISTANCE up before retesting. Then it returns the median or average result depending on configuration.
It is still homing first.
I removed a doubled definition in the configuration.h. The doubled definition can be found in the git file, too.
The behaviour is still the same.
I assumed you homed first and then you send G30. G30 does not move to any position - it probes where you are only the offset for z probe is added. You should make sure it is only called above the bed. Firmware just checks if it is inside allowed coordinates.
If this is the probing for z min during regular home you need to provide a xy position where to do z home operation.
Then it will home over bed and not at wrong position.
Es ist exakt das Problem, dass ich eigentlich erwarte, dass mit G30 einfach ein einzelner Punkt mit der z-Sonde ausgemessen wird. Stattdessen wird ein Home durchgeführt und von dort aus um den offset verschoben gemessen.
The display shows the right values, but switches every second to ????.?? for all three axis, which seems to be the hint, that the position might be not calibrated.
Deleting the following lines makes it work as expected.
The following warnings might be the problem of the homing. Maybe the cold extrusion protection triggers a "position not calibrated"?
Is this with a version from today since I fixed some position handling stuff yesterday. If it is I need to do some tests. After homing all tools must be selectable or homing would have failed.
What are your tool offsets and homing directions?
https://drive.google.com/file/d/18lus9RrsjyiOURupdu7FEb0IzOQ6kqa3/view?usp=sharing
Please send
M111 S7
first and then try homing and post log. That will make the firmware output the position that it did not like. I think it is easier to follow when we see which "illegal move" gets prevented. Reported position is in transformed coordinates so offsets and rotation corrections are subtracted already. With some bad luck it is just a rounding error.
here it is with "endstop distance after moving" for all axis with values 0mm
here it is with "endstop distance after moving" for all axis with positive value 110mm (to be be larger than the offset of my probe)
edit:
my configuration_io.h : https://drive.google.com/file/d/1ojh8FUHkGysqlGV3lRRV2RvNh_cOHltA/view?usp=sharing
my configuration.h: https://drive.google.com/file/d/1XqM3yM__EYSHn7kTJCIbPa9DbH9lV_4A/view?usp=sharing
#define RAISE_Z_ON_TOOLCHANGE 2
so when selecting tool it raises 2 mm to 161 which is higher then z max and is illegal.
I have updated github and now limit z on toolchange to z max. Hope that solves it.
Looking configuration I see
#define ENDSTOP_Z_BACK_ON_HOME 0
That should be a value higher then max. rotation of bed, so maybe 2mm when you are good leveled. And z max must then reduced by that value. Reason is otherwise moving xy at zmax could trigger z max end stop. On the other side I'm quite sure I added a safety margin when calculating the rotation so it should add the extra margin even with 0. But a small safety is never wrong here.
Will check tomorrow more closely into the problem.
Z_PROBE_BORDER is used to measure testable area on bed. Lets say you x is -65 ... 458 but bed is 0...400. Now if you have induction probe you can not probe at the edge x=0 - that gives different heights then with more metal below sensor. So Z_PROBE_BORDER reduces bed size by that distance to assure probe is far enough on bed.
So it is in deed coming from the transformation. So only question is where and why. I think I need to go down a bit after homing to the real 159mm for current xy position. Will check if that happens or not.
So if in my upper post something was misleading, it is my fault. Sorry for that.
It takes the transformed coordinates and computes the official coordinates. For xy this is normally nearly the same value. For Z it depends on rotation and xy position. We always assume the coordinate system rotates around 0,0,0. No move so far. But at end of homeAxis you have this:
which moves especially Z to make place for z corrections without hitting end stop (zpCorr with zRot and rotMinMax). That is the last z move you see I think.
What we need to achieve is that at the end the official z position is <= your set z max position. If that is not the case you get the illegal position message when the tool gets activated.
Looking a bit further downwards I see:
here you see I first switch extruder and then move to target position. That could be the problem we have with your positions. It should be the other way around. Can you replace this with
Nice you have the old version where the debug output was forgotton. The axis failing is Y axis and not Z as we expect. Y limit is 400.0 and first try where autolevel was disabled you see Y400 while with correction it was 400.08 so outside!
Ok we are quite close. Please add
#define DEBUG_MOVES
in your configuration.h so we get some more informations and enable echo
M111 S7
Also modify the homeAxes end to get some more informations:
Com::printFLN(PSTR("Position before select"));
As I understand we are still at making G28 work. So send full output of that. That should then provide all informations on what is going on. We can also see every move with distances that gets made. So perfect for analysis.