Results 251 to 260 of 757
Hybrid View
-
09-11-2014, 04:25 PM #1
I couldn't find it in this post but did come across this on: http://forums.reprap.org/read.php?151,246132,page=11
Regpye: Find this code block in the G29 command. If you replace it with the slightly modified version, the probe will only kick down at the start and then retract at the very end. That is better from a repeatability perspective because you only get the probe positioning error once, not once per probed point.
for (double yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION+.001 /* incase of round off errors */ ; yProbe += yGridSpacing)
{
double xProbe, xInc;
if (zig)
{
xProbe = LEFT_PROBE_BED_POSITION;
//xEnd = RIGHT_PROBE_BED_POSITION;
xInc = xGridSpacing;
zig = false;
} else // zag
{
xProbe = RIGHT_PROBE_BED_POSITION;
//xEnd = LEFT_PROBE_BED_POSITION;
xInc = -xGridSpacing;
zig = true;
}
for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
{
if (probePointCounter == 0)
{
// raise before probing
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
engage_z_probe(); // EDN wants the probe to only kick down once, so we do it
// before we start the probe loop.
} else
{
// raise extruder
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
}
do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
// engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
eqnBVector[probePointCounter] = current_position[Z_AXIS];
// retract_z_probe();
eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELI NG_POINTS] = xProbe;
eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELI NG_POINTS] = yProbe;
eqnAMatrix[probePointCounter + 2*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELI NG_POINTS] = 1;
probePointCounter++;
xProbe += xInc;
}
}
retract_z_probe(); // EDN moved this to end so we only kick down the probe once
// and only bring it back up once. This helps the repeatability
// of the Z-Probe in many implementations.
clean_up_after_endstop_move();
-
09-11-2014, 05:44 PM #2
Actually... I could be mistaken... But I think that feature is already folded back into the code provided in the very first post of this thread.
Is this the feature you are talking about?
- This step is also optional. Because of how some people's Z-Probe is constructed, it is best to raise the nozzle prior to retracting the probe. The Enhanced G29 code handles this circumstance. But as it turns out, the stock G28 command is also guilty of this bad behavior. If you need the G28 command to raise the nozzle prior to retracting the probe, make the following changes in Marlin_Main.cpp :
Find the following code:// Retract Servo endstop if enabled
#ifdef SERVO_ENDSTOPS
if (servo_endstops[axis] > -1) {
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
}
#endif
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (axis==Z_AXIS) retract_z_probe();
#endifadd these lines of code immediately after the "// Retract Servo endstop if enabled" comment.#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (axis==Z_AXIS)
do_blocking_move_relative(0, 0, Z_RAISE_BEFORE_PROBING);
#endif
It should look like this when you have made the change:// Retract Servo endstop if enabled#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (axis==Z_AXIS)
do_blocking_move_relative(0, 0, Z_RAISE_BEFORE_PROBING);
#endif
#ifdef SERVO_ENDSTOPS
if (servo_endstops[axis] > -1) {
servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
}
#endif
#if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if (axis==Z_AXIS) retract_z_probe();
#endifLast edited by Roxy; 09-11-2014 at 05:55 PM.
-
09-11-2014, 08:43 PM #3
- Join Date
- Aug 2014
- Posts
- 627
DjWang: That is not the same code but after looking at the newest code it seems the culprit is in probe_pt but I just spotted something of interest:
if (retract_probe)
retract_z_probe();
Hmmmm, g29 with an E it makes the retract_flag++ (=1) but I never use G29 E so not sure what is going on.
perfect as this new code does not retract my Z probe each time but I have to admit I am going to change the engage part of probe_pt so if the retract flag is zip the engage will only happen once as well. No need to tell the servo to deploy more than once as that will make the servo engage and will skew the numbers possibly.
Both of these changes are in Marlin_Main.cpp
Go around line 1614 and you will see something like thisCode:for (int xCount=0; xCount < n_points; xCount++) { float z_before; if (probePointCounter == 0) {
Code:if (retract_flag == 0) engage_z_probe(); // Engage Z Servo endstop if available for (int xCount=0; xCount < n_points; xCount++) { float z_before; if (probePointCounter == 0) {
Code:engage_z_probe(); // Engage Z Servo endstop if available run_z_probe();
Code:if (retract_probe) engage_z_probe(); // Engage Z Servo endstop if available run_z_probe();
Last edited by DarkAlchemist; 09-11-2014 at 09:32 PM.
-
09-11-2014, 05:57 PM #4
-
09-11-2014, 07:04 PM #5
-
09-11-2014, 11:21 AM #6
There is a post here that talks about that so you can stop that default action. I know this is a long thread but it's here somewhere. I used it and my arm lowers, takes 9 probes, and then goes up to begin printing.
Bambu P1S/AMS
NVision4D http://nvision4d.com
-
09-11-2014, 11:34 AM #7
- Join Date
- Aug 2014
- Posts
- 627
Ahhh, so I was right and it really isn't needed? Good to know and my accuracy will go through the roof with it removed (as can be seen with my M48 without the E).
I wonder what the original intention of that was?
Thanks.
edit: Ugh, I have reread the first 16 pages of this thread four times and I am just not seeing it but I do agree with your point from July saying this thread is just too big now.Last edited by DarkAlchemist; 09-11-2014 at 11:50 AM.
-
09-11-2014, 02:37 PM #8
-
09-11-2014, 02:29 PM #9
Well... Think about this.... The Auto Bed Leveling code for Marlin was done by somebody truly gifted about a year ago. He coded up the pattern that you are seeing. And certainly, on the surface, it makes sense. Lower the probe until it touches, back off a little bit and re-take the measurement at a slow speed for increased accuracy. And then raise the probe a safe amount and move to the next point. Part of this was he was trying to make the code general purpose so it would work on most people's machine. But a big part of it is he was just trying to get it to work. And once he found a solution to a problem, he moved on to the next show stopper.
Since then, only a few changes have been made. Marlin doesn't have as many firmware developers as it deserves to have. So... There are going to be things that seem like they should be changed, but not enough people are playing with it to make it happen.
A good example is this: The original developer obviously did not have a Z-Probe that had to be raised prior to retraction. But a fair number of Marlin users do have this condition. That 'fix' had to be added after the fact. He didn't realize this condition even existed because he never saw it. If he had seen it, none of us would have seen it because it would have been fixed before we got the code.Last edited by Roxy; 09-11-2014 at 02:35 PM.
-
09-14-2014, 06:23 PM #10
- Join Date
- Jun 2014
- Posts
- 74
Roxy- I can't tell you how much I appreciate your code and this thread. It's been a week long adventure getting ABL working on my i3V, and it wouldn't have worked (because of the probe hitting the glass during retract) without your code added. Plus, all the new features you added like topographic maps, etc. I originally decided to implement your code just for the Z raise before retract, but there is a lot more in your code that adds great value, and my prints are so much better now! So just wanted to say thanks and let you know that after many hours getting everything to work my printer's quality has significantly surpassed my expectations. So great job!
For anyone struggling to get this code change working (I certainly did), stick with it... the results are really worth the effort. And if you're new to any kind of programming like I am, you will learn a ton about how all the code works that creates the magic in the process.
Please explain to me how to...
Yesterday, 10:55 PM in 3D Printer Parts, Filament & Materials