MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.34k stars 19.26k forks source link

strange auto level behaviour... #1769

Closed MoonshineSG closed 9 years ago

MoonshineSG commented 9 years ago

Using the latest codes (as of posting), I have some strange behaviour:

  1. When issuing code M401 the probe deploys without raising Z. M402 (retract) first moves the Z up with 15 then retracts the probe. Shouldn't be the other way, or raise/ensure Z is high enough for both M401 and M402?
  2. After performing a auto leveling (G29 P3 V3 T) the Z is left at an odd difference of around 7.2mm and it basically prints "in the air" ...
  3. During G29 the probe raises more that pre-setup 5 (Z_RAISE_BETWEEN_PROBINGS) between the different points during probing...

Can anyone explain/help? Before doing the latest updates, I was able to print at fairly ok quality, but with very troublesome manual leveling of the bed, so I setup a servo arm to do auto leveling.

Configuration.h: http://pastebin.com/is1bQAcn

Wurstnase commented 9 years ago

2.) I've seen the same. While probing the Z-axis is moving twice. Only then at the first position it's only moving once.

MoonshineSG commented 9 years ago

Yes, smth like that .. it moves up in 2 steps....

thinkyhead commented 9 years ago

1764 addresses some issues in the general area of probing and leveling. Try the latest code and see if it improves anything. I've been adding some more documentation to these functions, hoping to make the flow clearer. Hopefully this will all be more solid soon.

MoonshineSG commented 9 years ago

Deployed 1764 and the results are below:

  1. Still the same (most likely not changed)
  2. After G29 the Z0 is still too high (about 5mm in my case)
  3. still happening. From second autolevel point the raising of the probe happens on a "2 step" higher than the Z_RAISE_BETWEEN_PROBINGS
roboprint commented 9 years ago

Same results for 2 and 3, using delta printer

mhespenh commented 9 years ago

2) Offset appears to be around 4mm (across entire bed plane) on my Prusa i3, able to correct it after G29 by adding -4mm to M851 value.

3) Confirmed same as MoonshineSG- Z-axis raises 'Z_RAISE_BETWEEN_PROBINGS'mm twice with slight delay between each between every probe-point.

thinkyhead commented 9 years ago

Thanks for the reports. I'll have another long look at the code, continue to document, and hopefully it will become more clear where it's messing up. Some of this began with moving the Z_RAISE into the retract_probe routine. If the probe is already retracted, it should bail out of retract_probe right away, and I suspect it may not be doing this.

If someone wants to take the initiative to add lots of SERIAL_ECHO commands to all the involved functions, and get a full snapshot of the flow, that would be excellent. I could maybe do probe testing without a probe (as I don't have one) by pretending that the Z min endstop is a probe, but I think it will be easier and better for users with actual probes to play around with this.

Natealus commented 9 years ago

So I found something interesting that verifies this double Z movement between probings. It turns out it is related to the Z_RAISE_AFTER_PROBING setting because it moves the 50mm of that first...then the 20 I put in for BETWEEN_PROBINGS. In fact I was able to verify that Z_RAISE_BEFORE_PROBING actually was having no effect because I took it all the way to 70mm and it still was deploying my servo probe too close to the bed. When I raised BETWEEN_PROBINGS from 10mm to 20mm it regained that Z height it needed to not contact the probe.

But as well I have Z_RAISE_AFTER_PROBING commented out for a few days because it would hijack the Manual Z I had of 367.55 to the value of AFTER_PROBING of 50mm. And thus would probe in mid air and get nothing. On the most recent merges I decided to enable it as I wanted a through test and it turns out that now it Adds that 50 to the 367.55 for a total of 417.55. So I've adjusted the manual Z to compensate to continue testing and thats when I discovered this "Double Raise" on the Z height and that its directly related to Z_RAISE_AFTER_PROBING.

As I tested in several different configuration variables, I've verified that Z_RAISE_BEFORE_PROBING seems to have no effect on the G29 auto probing process.

TechMasterJoe commented 9 years ago

comparing code i find this current build

float measured_z,
      z_before = Z_RAISE_BETWEEN_PROBINGS +
        (probePointCounter ? current_position[Z_AXIS] : 0);

build i downloaded on 3-15-15

float measured_z,
      z_before = probePointCounter == 0
        ? Z_RAISE_BEFORE_PROBING
        : current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS;

my head says they do the same but giving the math fake data to display using a uno i get mixed numbers granted the best way is to swap them and see but its 5am and to many sleepy people to wake up

Natealus commented 9 years ago

Time for the morning routine to shine hmm? :)

But yeah it looks like the RAISE_BEFORE got knocked out of the current build in that section but could that section be called for setting the initial Z position for each probing and maybe a split off Z_RAISE_BEFORE_PROBING call isn't getting pointed to?

thinkyhead commented 9 years ago

1798

MoonshineSG commented 9 years ago

Tested with a3e129e091.

none of the above 1, 2 or 3 seems fixed. And it is super strange... it starts with G28….

I have defined in source Z_PROBE_OFFSET_FROM_EXTRUDER -5.5, and I overwrite this value using M851 Z-2.70 and save to EEPROM

After a G28 when I do G1 Z0, the nozzle is left at a certain distance from the bed. I am allowed to go to minus values up to the value I set in Configuration.h (in this case -5.5, but i tested with other values...). The -5.5 in this case is more than the distance between the bed and the nozzle so it would push the bed (and probably crack the glass if I try) The actual distance between the nozzle and the bed when doing a G1 Z0 after a G28 is 4.5 and I can't figure out where that came from...

thinkyhead commented 9 years ago

@MoonshineSG Sometimes it's the difference between some setting, as in 10.0 - 4.5 = 5.5.

MoonshineSG commented 9 years ago

But that 5.5 should have been overwritten by the 2.7... Or I am misunderstanding what the M851 does...

MoonshineSG commented 9 years ago

And my settings are:

#define Z_RAISE_BEFORE_HOMING  15   
#define Z_RAISE_BEFORE_PROBING 15   
#define Z_RAISE_BETWEEN_PROBINGS 5  
#define Z_RAISE_AFTER_PROBING 15  

no 10 here..

thinkyhead commented 9 years ago

Process of illumination. :bulb:

TechMasterJoe commented 9 years ago

OK i did a few test and added some mindless debugging. Here's what I see:

When it calls probe_pt, the first thing it calls is…

do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before); // Line 1340

It's getting "z_before" from:

float measured_z, // Line 2315
      z_before = Z_RAISE_BETWEEN_PROBINGS + (probePointCounter ? current_position[Z_AXIS] : 0);

…then…

do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);

…and then…

#if Z_RAISE_BETWEEN_PROBINGS > 0
  if (retract_action == ProbeStay) {
    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
    st_synchronize();
  }
#endif
...

i can confirm that first move is the cause of the 2 step i made my grid smaller and added a current_position[X_AXIS]+10.0 now after first raise it X by 10.0 while moving Z So it's adding the Z_RAISE_BETWEEN_PROBINGS twice – at the end of a routine, then just before moving to the next. Hope my ramblings help lol i only have about a year and a half of C++ and about 1 with arduino / teensy 3.1 (i do know arduino IDE is odd i started with C# and moved into AVR Studio)

thinkyhead commented 9 years ago

Ha, I think you've got something there. I will look more closely after much needed sleep! :zzz:

TechMasterJoe commented 9 years ago

this is what i have done to probe_pt in a way that supports both delta and us other guys lol but it needs a way to skip the first point for delta's much like the z_before skips point 0 it did fix the Z offset problems i was having as well

static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=3) {
     #ifdef DELTA
        #if Z_RAISE_BETWEEN_PROBINGS > 0
        if (retract_action == ProbeStay) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS); st_synchronize(); }
        #endif
     #else
        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
     #endif
    // move to right place  
    do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);

    #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
      if (retract_action & ProbeEngage) deploy_z_probe();
    #endif

    run_z_probe();
    float measured_z = current_position[Z_AXIS];

    #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
      if (retract_action & ProbeRetract) stow_z_probe();
    #endif

    if (verbose_level > 2) {
      SERIAL_PROTOCOLPGM(MSG_BED);
      SERIAL_PROTOCOLPGM(" X: ");
      SERIAL_PROTOCOL_F(x, 3);
      SERIAL_PROTOCOLPGM(" Y: ");
      SERIAL_PROTOCOL_F(y, 3);
      SERIAL_PROTOCOLPGM(" Z: ");
      SERIAL_PROTOCOL_F(measured_z, 3);
      SERIAL_EOL;
    }
    return measured_z;
  }

fixed error from coping

TechMasterJoe commented 9 years ago

I know I'm eating a ton of space but hey like it materhackers

doing it this way might get around the need to pass a probe count for delta's

static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=3) {
     #ifndef DELTA
        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
     #endif
    // move to right place  
    do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);

    #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
      if (retract_action & ProbeEngage) deploy_z_probe();
    #endif

    run_z_probe();
    float measured_z = current_position[Z_AXIS];

     #ifdef DELTA
        #if Z_RAISE_BETWEEN_PROBINGS > 0
        if (retract_action == ProbeStay) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] += Z_RAISE_BETWEEN_PROBINGS); st_synchronize(); }
        #endif
     #endif

    #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
      if (retract_action & ProbeRetract) stow_z_probe();
    #endif

    if (verbose_level > 2) {
      SERIAL_PROTOCOLPGM(MSG_BED);
      SERIAL_PROTOCOLPGM(" X: ");
      SERIAL_PROTOCOL_F(x, 3);
      SERIAL_PROTOCOLPGM(" Y: ");
      SERIAL_PROTOCOL_F(y, 3);
      SERIAL_PROTOCOLPGM(" Z: ");
      SERIAL_PROTOCOL_F(measured_z, 3);
      SERIAL_EOL;
    }
    return measured_z;
  }
thinkyhead commented 9 years ago

Well, that function has long had z_before as an argument, which is, I believe. supposed to indicate the Z coordinate where the axis should go before starting the individual probe. The activation of the probe wasn't part of this function until recently, so there was more fine-grained control. I think it makes sense to go to each individual call to probe_pt and make a note about where the Z is supposed to be, before and after that individual call to probe_pt, and even insert the code that should be getting called for that part. Then it may become clear that another argument is needed, or that the tested conditions are lacking.

Just from a review of the code you show above, it seems like there is something missing. I'm thinking…

#ifdef DELTA
  #if Z_RAISE_BETWEEN_PROBINGS > 0
    if (retract_action == ProbeStay) {
      current_position[Z_AXIS] += Z_RAISE_BETWEEN_PROBINGS;
      do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
      st_synchronize();
    }
  #endif
#else
  do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
#endif
TechMasterJoe commented 9 years ago

i swear I'm not saying this to be a dick no really scroll right it's the same just all on the same line. all I do is agree with you I'm in PST it's 4:41AM I'm half asleep as it is so i might still be wrong lets just say auto spell correct is the only thing saving me now, i think i made 15 typos just typing this. the only reason i put the work in is i do have a probe and encoders on the printer next to me so if it moves i can tell how far +-.002mm far better then it can move given it's a 12" makerfarm i3v

all I'm tring to say is Hope it helps fix the bug so we can all gain from ABC (Auto Bed Comp) well time for FBS (Find Bed and Sleep)

thinkyhead commented 9 years ago

Not the same. The code is updating current_position[Z_AXIS] before calling do_blocking_move, whereas the old code passes current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS as the last argument.

In any case, I followed the codepath, and I see that it's not necessary. The value gets updated at the end of prepare_move_raw.

TechMasterJoe commented 9 years ago

ah ya i see it now. back to that sleep thing if i get annoying just tell me off lol well i'm really going to sleep now so check back in a few hours im up lol

TechMasterJoe commented 9 years ago

after looking even more and to the sum of 80 echo's it looks like Z_RAISE_AFTER_PROBING is get added once but moves twice set it to 10 mm and Z probe thinks it's 10mm+ probe offset in this case 12.15 is on the LCD for me but it's really 22.15 this adds the extra 7.85 I'm seeing on the dot the odd part is it don't even know that it's an extra 10mm up and i can not find for the life of me where that 2X is movement is happening

after every flash M502 M500 and M501 are called then a reconnect to confirm hard coded settings are loaded

echo:  M205 S0.00 T0.00 B20000 X20.00 Z0.80 E5.00
echo:Home offset (mm):
echo:  M206 X0.00 Y0.00 Z0.00
echo:PID settings:
echo:  M301 P22.20 I1.08 D100.00
echo:Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)
echo:  M207 S1.00 F1500.00 Z0.00
echo:Recover: S=Extra length (mm) F:Speed (mm/m)
echo:  M208 S0.00 F480.00
echo:Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries
echo:  M209 S0
echo:Filament settings: Disabled
echo:Z-Probe Offset (mm):
echo:  M851 Z-2.15
ok
N17 G28 *5
#1480 Z: 0.000
#1490 Z: 0.000
#1499 Z: 0.000
#983 current_position 0.000
#983 base_home_pos 0.000
#983 home_offset 0.000
#1555 Z: 0.000
#1480 Z: 0.000
#1490 Z: 0.000
#1499 Z: 0.000
#983 current_position 0.000
#983 base_home_pos 0.000
#983 home_offset 0.000
#1555 Z: 0.000
#1948 Z: 0.000
#1206 deploy_Z_probe
#1480 Z: 0.000
#1490 Z: 0.000
#1499 Z: 0.000
#983 current_position 0.000
#983 base_home_pos 0.000
#983 home_offset 0.000
#1555 Z: 0.000
#1274 Z_RAISE_AFTER_PROBING set to 0
#1285 Retract_Z_probe
#2011 Z: 2.150
ok

the # are line numbers some are moved around a line or two but damn close as you can see i hard set Z raise after probing to 0 so it thinks it's 2.15mm off the bed but Z raise after probing still moved it 10mm that's not counted for so ZERO is really 7.85mm off the bed and nozzle is 12.15mm

i hope this helps point use in a direction i have been messing with it for about 2 hours now and can't seem to find it, it's tapping twice going up (not even post to with it coded to 0 in servo stow call) then retracting servo

thinkyhead commented 9 years ago

Thanks @TechMasterJoe – every bit of information helps. I will be going over this whole leveling fiasco more thoroughly again tonight.

TechMasterJoe commented 9 years ago

just synced to current build as of 3mins ago testing and adding echo's add needed fails to raise_before_probing on safe Z probe raise works on G28 Z trying to rise and go to center at same time

TechMasterJoe commented 9 years ago

STUPID FACT over the last 2 months marlins active Size has shrunk over 20Kb for me RAMBO + reprap graphic LCD + ABL was over 176,3XX bytes now under 144,xxx bytes so thank you very much @thinkyhead

TechMasterJoe commented 9 years ago

current build Z_RAISE_AFTER_PROBING dead trying a few things but it don't rise at all pro is the offsets are right now

thinkyhead commented 9 years ago

@TechMasterJoe Arduino 1.6.2 compiles Marlin something like 5K smaller also, so thank you open source movement!

thinkyhead commented 9 years ago

I've been taking notes on z raising, but I still haven't gone through the code and followed the full flow. I have several leads to follow up on in my notes.

ear0wax commented 9 years ago

I can confirm that Raise between probings wasn't working with last night build I would up rolling back firmwares.

maar1201gh commented 9 years ago

Changing line code 1349 in Marlin_main.cpp removes the "2 step" higher FROM:

do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);

TO:

do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);

BUT, STILL EXTRUDING ON THE AIR

thinkyhead commented 9 years ago

If someone is able to add SERIAL_ECHO commands throughout the leveling code to print out the values of current_position[Z_AXIS], destination[Z_AXIS], the stepper's view of the current position (insert a SERIAL_ECHO into st_synchronize), the state of the endstops, and all that kind of thing, then it would give a nice clear picture of what is happening and when. If this sounds daunting, I can do the job – I will add a bunch of debug output to the code and make a #define for it which is off by default – you can enable it and then we'll have some good data to work with.

MoonshineSG commented 9 years ago

If you add the ECHO I can run a couple of tests and send you the results. I would add them myself, but I am not sure where...

TechMasterJoe commented 9 years ago

under what section toss me a file name and a line / call to look for and i will start adding them i can test it any time i have a dev copy untouched with config setup complete if you want to just add them and send the file to me email my user name @ gmail. then i can just swap the file and log the the data, i have a 32ch 100mhz logic analyzer and can wire up to all the outputs as well if you want to get real data i can sync and time stamp the files to match

just Z or ordered X Y Z per line

thinkyhead commented 9 years ago

Little by little fixing I'm fixing up the probe leveling. The probe should now deploy with G29 in cases where the X probe starts from the right. At the moment I am adding SERIAL_ECHO throughout the leveling process. I will post that soon, and after the data has been collected I will remove the extra code.

thinkyhead commented 9 years ago

Ok, I have posted the latest code, with debugging added. To help debug the probing behavior, get the code at this branch:

https://github.com/thinkyhead/Marlin/archive/debug_G29.zip

Find the option at the top of Marlin_main.cpp named DEBUG_LEVELING and enable it. Then run probing, if possible, and you will see output to the serial console. Paste the output from the serial console on Issue #1844.

MoonshineSG commented 9 years ago
src/Marlin_main.cpp:1245:77: error: macro "SERIAL_ECHOLNPGM" passed 2 arguments, but takes just 1
src/Marlin_main.cpp: In function ‘void print_xyz(const char*, float, float, float)’:
src/Marlin_main.cpp:1028:7: error: initializer fails to determine size of ‘__c’
src/Marlin_main.cpp: In function ‘void deploy_z_probe()’:
src/Marlin_main.cpp:1245:7: error: ‘SERIAL_ECHOLNPGM’ was not declared in this scope
src/Marlin_main.cpp: In function ‘float probe_pt(float, float, float, ProbeAction, int)’:
src/Marlin_main.cpp:1395:7: error: call of overloaded ‘serial_echopair_P(const char*, ProbeAction&)’ is ambiguous
src/Marlin_main.cpp:1395:7: note: candidates are:
src/Marlin_main.cpp:382:6: note: void serial_echopair_P(const char*, float)
src/Marlin_main.cpp:383:6: note: void serial_echopair_P(const char*, double)
src/Marlin_main.cpp:384:6: note: void serial_echopair_P(const char*, long unsigned int)
src/Marlin_main.cpp:1429:11: error: call of overloaded ‘serial_echopair_P(const char*, int)’ is ambiguous
src/Marlin_main.cpp:1429:11: note: candidates are:
src/Marlin_main.cpp:382:6: note: void serial_echopair_P(const char*, float)
src/Marlin_main.cpp:383:6: note: void serial_echopair_P(const char*, double)
src/Marlin_main.cpp:384:6: note: void serial_echopair_P(const char*, long unsigned int)
src/Marlin_main.cpp: In function ‘void homeaxis(AxisEnum)’:
src/Marlin_main.cpp:1629:7: error: call of overloaded ‘serial_echopair_P(const char*, AxisEnum&)’ is ambiguous
src/Marlin_main.cpp:1629:7: note: candidates are:
src/Marlin_main.cpp:382:6: note: void serial_echopair_P(const char*, float)
src/Marlin_main.cpp:383:6: note: void serial_echopair_P(const char*, double)
src/Marlin_main.cpp:384:6: note: void serial_echopair_P(const char*, long unsigned int)
.build/mega2560/Makefile:1076: recipe for target '.build/mega2560/src/Marlin_main.o' failed
thinkyhead commented 9 years ago

Should be better now. https://github.com/thinkyhead/Marlin/archive/debug_G29.zip

MoonshineSG commented 9 years ago

The results are below, but the probe went way off to the right and I had to use my finger to trigger the Z-stop, otherwise the nozzle would have crashed into the glass... (my probe is right-back of the nozzle)

G28
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeX: (0.00, 0.00, 0.00)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeY: (0.00, 0.00, 0.00)
  > Z_SAFE_HOMING >>>
    > home_all_axis > destination: (52.00, 83.00, 15.00)
    deploy_z_probe > current_position: (52.00, 83.00, 0.00)
    home_axis with axis=2
    home_axis > current_position: (52.00, 83.00, 0.00)
    home_axis > SERVO_ENDSTOPS > Stow with write()
    home_axis(Z_AXIS) > SERVO_LEVELING > stow_z_probe
    stow_z_probe > current_position: (52.00, 83.00, 0.00)
    do_blocking_move_to: (52.00, 83.00, 15.00)
    > home_all_axis > final: (52.00, 83.00, 15.00)
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
ok

G29 P2 V3 T
gcode_G29 >>>
  G29 Auto Bed Leveling
  enable_endstops(true)
  probe_pt >>>
    > ProbeAction:1
    > current_position: (52.00, 83.01, 17.70)
    > do_blocking_move_to: (52.00, 83.01, 15.00)
    do_blocking_move_to: (52.00, 83.01, 15.00)
    > do_blocking_move_to: (2.00, 3.00, 15.00)
    do_blocking_move_to: (2.00, 3.00, 15.00)
    > ProbeDeploy
    deploy_z_probe > current_position: (2.00, 3.00, 15.00)
    run_z_probe > current_position: (2.00, 3.00, -1.40)
  Bed X: 45.000 Y: 15.000 Z: -1.399
  probe_pt >>>
    > ProbeAction:0
    > current_position: (2.00, 3.00, -1.40)
    > do_blocking_move_to: (2.00, 3.00, 3.60)
    do_blocking_move_to: (2.00, 3.00, 3.60)
    > do_blocking_move_to: (137.00, 3.00, 3.60)
    do_blocking_move_to: (137.00, 3.00, 3.60)
    run_z_probe > current_position: (137.00, 3.00, -12.00)
    Raise Z by 5
    > ProbeStay > do_blocking_move_to: (137.00, 3.00, -7.00)
    do_blocking_move_to: (137.00, 3.00, -7.00)
  Bed X: 180.000 Y: 15.000 Z: -12.000
  probe_pt >>>
    > ProbeAction:0
    > current_position: (137.00, 3.00, -7.00)
    > do_blocking_move_to: (137.00, 3.00, -2.00)
    do_blocking_move_to: (137.00, 3.00, -2.00)
    > do_blocking_move_to: (2.00, 168.00, -2.00)
    do_blocking_move_to: (2.00, 168.00, -2.00)
    run_z_probe > current_position: (2.00, 168.00, -1.90)
    Raise Z by 5
    > ProbeStay > do_blocking_move_to: (2.00, 168.00, 3.10)
    do_blocking_move_to: (2.00, 168.00, 3.10)
  Bed X: 45.000 Y: 180.000 Z: -1.901
  probe_pt >>>
    > ProbeAction:2
    > current_position: (2.00, 168.00, 3.10)
    > do_blocking_move_to: (2.00, 168.00, 8.10)
    do_blocking_move_to: (2.00, 168.00, 8.10)
    > do_blocking_move_to: (137.00, 168.00, 8.10)
    do_blocking_move_to: (137.00, 168.00, 8.10)
    run_z_probe > current_position: (137.00, 168.00, -3.52)
    > ProbeStow
    stow_z_probe > current_position: (137.00, 168.00, -3.52)
    do_blocking_move_to: (137.00, 168.00, 11.48)
  Bed X: 180.000 Y: 180.000 Z: -3.520
  > probing complete > current_position: (137.00, 168.00, 11.48)
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
  Eqn coefficients: a: -0.04525634 b: 0.02417526 d: -1.97079811
  Mean of sampled points: -4.70504903

  Bed Height Topography:
  +-----------+
  |...Back....|
  |Left..Right|
  |...Front...|
  +-----------+
   +2.80357 +1.18534
   +3.30603 -7.29495

  planeNormal x: 0.045256 y: -0.024175 z: 1.000000
  set_bed_level_equation_lsq > current_position: (136.35, 168.38, 13.60)

  Bed Level Correction Matrix:
  +0.998978 +0.000000 -0.045210
  +0.001092 +0.999709 +0.024119
  +0.045197 -0.024143 +0.998686
  Z Probe End Script: G1 X0 Y0 F20000
  enqueueing "G1 X0 Y0 F20000"
<<< gcode_G29

M503 S0
  M92 X80.50 Y80.50 Z406.00 E83.17
  M203 X500.00 Y500.00 Z5.00 E35.00
  M201 X5000 Y5000 Z90 E10000
  M204 P950.00 R950.00 T950.00
  M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00
  M206 X0.00 Y0.00 Z0.00

  M301 P84.66 I12.30 D145.65
  M304 P259.05 I48.80 D343.79
  M851 Z-2.70

[results from octopi Version: 1.2.0-dev-668-g3ebd54d (devel branch) - if this makes a difference... ]

lrpirlet commented 9 years ago

OK, I have been testing the code I got last week-end... I have a Prusa I3. It looks like I have a problem with G28, G29 (2 different issues maybe ) and M48... I never get my Hot-end to home Z correctly... At the end of G28 and G29 (5*5 probe) after a G1 Z0, the head is 4mm away from the bed. the M48 finds a negative position that added to the probe-offset sums up to 4 mm Then if I G29 with P2 (multiple of 2)... it gets crazy... Please find here some, hopefully, relevant information..

Note added: EEPROM is disabled to avoid unnoticed parameters modification.

I will now use the modified code and try again.... Sorry, depending on time available, I may have some results tomorrow or the day after... I will not post anything if you fix it before ...

BTW, thanks for your efforts.

Sorry, I made a mistake and did NOT keep the development configuration.h when I compiled an old working firmware in the printer...

Louis Richard

+++++++++++++ Configuration.H extracts +++++++++++++

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.

// Travel limits after homing (units are in mm)
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS 190
#define Y_MAX_POS 190
#define Z_MAX_POS 168

  // Offsets to the probe relative to the extruder tip (Hotend - Probe)
  // X and Y offsets must be integers
  #define X_PROBE_OFFSET_FROM_EXTRUDER -19 //-19.20 Probe on: -left  +right
  #define Y_PROBE_OFFSET_FROM_EXTRUDER -9  //-9.40 Probe on: -front +behind
  #define Z_PROBE_OFFSET_FROM_EXTRUDER -2.33  //-2.33 -below (always!)

  #define Z_RAISE_BEFORE_HOMING 6       // (in mm) Raise Z before homing (G28) for Probe Clearance.
                                        // Be sure you have this distance over your Z_MAX_POS in case

  #define XY_TRAVEL_SPEED 6000         // X and Y axis travel speed between probes, in mm/min

  #define Z_RAISE_BEFORE_PROBING 8   //How much the extruder will be raised before traveling to the first probing point.
  #define Z_RAISE_BETWEEN_PROBINGS 2  //How much the extruder will be raised when traveling from between next probing points
  #define Z_RAISE_AFTER_PROBING 8    //How much the extruder will be raised after the last probing point.

++++++++repetier logs and comments +++++++++++

19:38:09.074 : start
19:38:09.074 : echo: External Reset
19:38:09.074 : Marlin1.0.2
19:38:09.074 : echo: Last Updated: Apr  6 2015 21:59:14 | Author: LRP
19:38:09.074 : Compiled: Apr  6 2015
19:38:09.074 : echo: Free Memory: 2842  PlannerBufferBytes: 1232
19:38:09.074 : echo:Hardcoded Default Settings Loaded
19:38:09.074 : echo:Steps per unit:
19:38:09.074 : echo:  M92 X80.00 Y80.00 Z4000.00 E406.00
19:38:09.074 : echo:Maximum feedrates (mm/s):
19:38:09.074 : echo:  M203 X200.00 Y200.00 Z1.00 E45.00
19:38:09.074 : echo:Maximum Acceleration (mm/s2):
19:38:09.074 : echo:  M201 X1000 Y1000 Z50 E5000
19:38:09.074 : echo:Accelerations: P=printing, R=retract and T=travel
19:38:09.074 : echo:  M204 P1500.00 R2000.00 T1500.00
19:38:09.090 : echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), Xho:Home oXY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)
19:38:09.090 : echo:  M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00
19:38:09.090 : echo:Home offset (mm):
19:38:09.090 : echo:  M206 X0.00 Y0.00 Z0.00
19:38:09.090 : echo:PID settings:
19:38:09.090 : echo:  M30122.41 I1.56 D80.41
19:38:09.090 : echo:Filament settings: Disabled
19:38:09.090 : echo:Z-Probe Offset (mm):
19:38:09.090 : echo:  M851 Z-2.33
19:38:09.542 : N1 M110 *2
19:38:09.542 : N1 M110 *2
19:38:09.542 : N2 M115 *4
19:38:10.135 : N4 M111 S6 *67
19:38:10.151 : N5 T0 *31
19:38:10.151 : N6 M20 *55
19:38:10.151 : N7 M80 *60
19:38:13.021 : echo:SD init fail
19:38:13.037 : echo:Unknown command: ""
19:38:13.037 : ok
19:38:13.115 : ok
19:38:13.130 : FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Pi3 3D LabteK EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000
19:38:13.130 : ok
19:38:13.130 : N9 M220 S100 *72
19:38:13.130 : N10 M221 S100 *113
19:38:13.130 : N11 M111 S6 *119
19:38:13.130 : N12 T0 *41
19:38:13.146 : ok
19:38:13.146 : echo:Active Extruder: 0
19:38:13.146 : ok
19:38:13.146 : Begin file list
19:38:13.146 : End file list
19:38:13.146 : ok
19:38:13.146 : Error:No Line Number with checksum, Last Line: 8
19:38:13.146 : ok
19:38:13.146 : Error:Line Number is not Last Line Number+1, Last Line: 8
19:38:13.146 : Resend: 9
19:38:13.162 : ok
19:38:13.162 : Resend: N9 M220 S100 *72
19:38:13.162 : Resend: N10 M221 S100 *113
19:38:13.162 : Resend: N11 M111 S6 *119
19:38:13.162 : Resend: N12 T0 *41
19:38:13.162 : ok
19:38:13.162 : ok
19:38:13.162 : ok
19:38:13.162 : echo:Active Extruder: 0
19:38:13.162 : ok
19:38:36.109 : N24 G28 *5
19:39:20.398 : ok
19:41:44.027 : N103 M114 *5
19:41:44.027 : X:114.00 Y:104.00 Z:10.33 E:0.00 Count X: 114.00 Y:104.00 Z:10.33

X and Y are at the expected place... Z also: 8 + 2.33 = 10.33

19:41:44.027 : ok
19:42:03.047 : N113 G1 Z0 *65
19:42:03.047 : ok
19:42:18.054 : N121 M114 *5
19:42:18.054 : X:114.00 Y:104.00 Z:0.00 E:0.00 Count X: 114.00 Y:104.00 Z:0.00
19:42:18.054 : ok

distance bed-hotend = 4,02 mmm (maesred using several sheets of paper... maybe approximative)

19:45:18.219 : N209 M48 V4 *118
19:45:18.219 : M48 Z-Probe Repeatability test
19:45:26.253 : Positioning the probe...
19:46:07.780 : 1 of 10   z: -1.670750 mean: -1.670750   sigma: 0.000000
19:46:31.586 : 2 of 10   z: -1.685750 mean: -1.678250   sigma: 0.007500
19:46:55.407 : 3 of 10   z: -1.687000 mean: -1.681167   sigma: 0.007383
19:47:19.212 : 4 of 10   z: -1.682000 mean: -1.681375   sigma: 0.006404
19:47:43.034 : 5 of 10   z: -1.686250 mean: -1.682350   sigma: 0.006051
19:48:06.948 : 6 of 10   z: -1.690000 mean: -1.683625   sigma: 0.006216
19:48:30.770 : 7 of 10   z: -1.685500 mean: -1.683893   sigma: 0.005792
19:48:54.638 : 8 of 10   z: -1.685750 mean: -1.684125   sigma: 0.005453
19:49:18.475 : 9 of 10   z: -1.690750 mean: -1.684861   sigma: 0.005547
19:49:42.296 : 10 of 10   z: -1.679500 mean: -1.684325   sigma: 0.005502
19:49:51.640 : Mean: -1.684325
19:49:51.640 : Standard Deviation: 0.005502
19:49:51.640 : ok
19:50:47.052 : N245 M114 *4
19:50:47.052 : X:114.00 Y:104.00 Z:6.32 E:0.00 Count X: 114.00 Y:104.00 Z:6.32
19:50:47.052 : ok
19:51:04.009 : N254 G1 Z0 *65
19:51:04.009 : ok

distance bed-hotend = 4.02 mm Funny, my Z-probe offset is -2.33 + (-1.684325) = 4,01432

19:59:29.336 : N498 G28 *54
20:00:13.437 : ok
20:00:17.118 : N509 M114 *11
20:00:17.118 : X:114.00 Y:104.00 Z:10.33 E:0.00 Count X: 114.00 Y:104.00 Z:10.33
20:00:17.118 : ok
20:00:25.246 : N514 G29 *50 

G29 probes 5*5 in zig-zag mode, probe down

20:00:25.246 : G29 Auto Bed Leveling
20:07:21.471 : Eqn coefficients: a: 0.00109500 b: -0.00027851 d: -1.78360462
20:07:21.471 : planeNormal x: -0.001095 y: 0.000279 z: 1.000000
20:07:21.471 : 
20:07:21.471 : Bed Level Correction Matrix:
20:07:21.471 : +0.999999 +0.000000 +0.001095
20:07:21.471 : +0.000000 +1.000000 -0.000279
20:07:21.471 : -0.001095 +0.000279 +0.999999
20:07:21.471 : ok
20:10:02.371 : N600 M114 *1
20:10:02.371 : X:186.01 Y:177.00 Z:6.17 E:0.00 Count X: 186.00 Y:177.00 Z:6.32
20:10:02.371 : ok
20:10:53.884 : N626 G1 Z0 *64
20:10:53.884 : ok
20:12:08.936 : N663 G28 X0 Y0 *49
20:12:24.755 : ok

Distance bed-hotend ~ 4mm (stack of paper goes under but it is harder to push. Correction for the bed?)

Z between probing is 2... could that be used twice??? I do NOT think so... My prusa I3 has 5 mm thread meaning .8 mm per turn... I count between 2 an 3 turns between probe...

20:21:43.764 : N941 G29 P2 *124
20:21:43.764 : echo:Home X/Y before Z

I waited too long here... need to activate stepper motor..

20:21:43.764 : ok
20:21:59.801 : N950 G28 X0 Y0 *62
20:22:01.018 : ok
20:22:08.568 : N955 G29 P2 *121

Here comes the fun... Probe first row ok... does not do zig-zag and goes to opposite corner from origin (in my case front left)... probe... then raise the probe and goes to 4th corner... try to probe ... I do have a Z-switch wired in parallel to the servo probe... so I let go...

20:22:08.568 : G29 Auto Bed Leveling
20:23:39.703 : Eqn coefficients: a: 0.00663226 b: -0.00626000 d: -2.38215875
20:23:39.719 : planeNormal x: -0.006632 y: 0.006260 z: 1.000000
20:23:39.719 : 
20:23:39.719 : Bed Level Correction Matrix:
20:23:39.719 : +0.999978 +0.000000 +0.006632
20:23:39.719 : +0.000042 +0.999980 -0.006260
20:23:39.719 : -0.006632 +0.006260 +0.999958
20:23:39.719 : ok
20:32:48.357 : N1229 M114 *63
20:32:48.357 : X:33.99 Y:179.01 Z:-0.98 E:0.00 Count X: 34.00 Y:179.00 Z:-1.88
20:32:48.357 : ok

YOUP it thinks it is UNDER the bed :-) just for Fun, I measure the height and get 2.42 mmm ... 1.88 + 2.30 = 4.18 I guess that the corrected plan added about 0.18 mm (But pls consider the measure error)

That 4 mm does not correspnd to anything except maybe in the Configuration_adv.h where I can see "Z_HOME_BUMP_MM 2" that gets multiplied by 2 in the HOMEAXIS routine ... Sorry I am NOT a programmer... I can read some C and sort of understand but in this case in am... completely lost. :-(

lrpirlet commented 9 years ago

OK, I found a backup of Configuration.h so was easy to edit the Marlin-more_configurator one... Got no time to write long comments... Head is stil 4 mm above bed.. no more problem with probe raizing when Probing 2*2... Here the repetier log.. I must correct, I do get twice a raise in G29 after first going up... Very funny, my head seems to travel INSIDE the bed, my printer report :-)

+++++++++repetier log++++++++

N22 G28 X0 Y0 *2
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeX: (0.00, 0.00, 0.00)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeY: (0.00, 0.00, 0.00)
  > Set X: (0.00, 0.00, 0.00)
  > Set Y: (0.00, 0.00, 0.00)
  > Z_SAFE_HOMING >>>
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
N40 G28 *7
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeX: (0.00, 0.00, 0.00)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 0.00)
  > homeY: (0.00, 0.00, 0.00)
  > Z_SAFE_HOMING >>>
  > home_all_axis > destination: (114.00, 104.00, 6.00)
  deploy_z_probe > current_position: (114.00, 104.00, 0.00)
  home_axis with axis=2
  home_axis > current_position: (114.00, 104.00, 0.00)
  home_axis > SERVO_ENDSTOPS > Stow with write()
  home_axis(Z_AXIS) > SERVO_LEVELING > stow_z_probe
  stow_z_probe > current_position: (114.00, 104.00, 0.00)
  do_blocking_move_to: (114.00, 104.00, 8.00)
  > home_all_axis > final: (114.00, 104.00, 8.00)
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
N58 M114 *58
X:114.00 Y:104.00 Z:10.33 E:0.00 Count X: 114.00 Y:104.00 Z:10.33
N84 G1 Z0 *126
N103 M114 *5
X:114.00 Y:104.00 Z:0.00 E:0.00 Count X: 114.00 Y:104.00 Z:0.00
N124 G29 V4 *119
gcode_G29 >>>
  G29 Auto Bed Leveling
  enable_endstops(true)
  probe_pt >>>
    > ProbeAction:1
    > current_position: (114.00, 104.00, 0.00)
    > do_blocking_move_to: (114.00, 104.00, 8.00)
    do_blocking_move_to: (114.00, 104.00, 8.00)
    > do_blocking_move_to: (34.00, 29.00, 8.00)
    do_blocking_move_to: (34.00, 29.00, 8.00)
    > ProbeDeploy
    deploy_z_probe > current_position: (34.00, 29.00, 8.00)
    run_z_probe > current_position: (34.00, 29.00, -1.74)
  Bed X: 15.000 Y: 20.000 Z: -1.740
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 29.00, -1.74)
    > do_blocking_move_to: (34.00, 29.00, 1.26)
    do_blocking_move_to: (34.00, 29.00, 1.26)
    > do_blocking_move_to: (72.00, 29.00, 1.26)
    do_blocking_move_to: (72.00, 29.00, 1.26)
    run_z_probe > current_position: (72.00, 29.00, -1.66)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (72.00, 29.00, 1.34)
    do_blocking_move_to: (72.00, 29.00, 1.34)
  Bed X: 53.000 Y: 20.000 Z: -1.664
  probe_pt >>>
    > ProbeAction:0
    > current_position: (72.00, 29.00, 1.34)
    > do_blocking_move_to: (72.00, 29.00, 4.34)
    do_blocking_move_to: (72.00, 29.00, 4.34)
    > do_blocking_move_to: (110.00, 29.00, 4.34)
    do_blocking_move_to: (110.00, 29.00, 4.34)
    run_z_probe > current_position: (110.00, 29.00, -1.62)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (110.00, 29.00, 1.38)
    do_blocking_move_to: (110.00, 29.00, 1.38)
  Bed X: 91.000 Y: 20.000 Z: -1.620
  probe_pt >>>
    > ProbeAction:0
    > current_position: (110.00, 29.00, 1.38)
    > do_blocking_move_to: (110.00, 29.00, 4.38)
    do_blocking_move_to: (110.00, 29.00, 4.38)
    > do_blocking_move_to: (148.00, 29.00, 4.38)
    do_blocking_move_to: (148.00, 29.00, 4.38)
    run_z_probe > current_position: (148.00, 29.00, -1.63)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (148.00, 29.00, 1.37)
    do_blocking_move_to: (148.00, 29.00, 1.37)
  Bed X: 129.000 Y: 20.000 Z: -1.627
  probe_pt >>>
    > ProbeAction:0
    > current_position: (148.00, 29.00, 1.37)
    > do_blocking_move_to: (148.00, 29.00, 4.37)
    do_blocking_move_to: (148.00, 29.00, 4.37)
    > do_blocking_move_to: (186.00, 29.00, 4.37)
    do_blocking_move_to: (186.00, 29.00, 4.37)
    run_z_probe > current_position: (186.00, 29.00, -1.63)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (186.00, 29.00, 1.37)
    do_blocking_move_to: (186.00, 29.00, 1.37)
  Bed X: 167.000 Y: 20.000 Z: -1.630
  probe_pt >>>
    > ProbeAction:0
    > current_position: (186.00, 29.00, 1.37)
    > do_blocking_move_to: (186.00, 29.00, 4.37)
    do_blocking_move_to: (186.00, 29.00, 4.37)
    > do_blocking_move_to: (34.00, 66.00, 4.37)
    do_blocking_move_to: (34.00, 66.00, 4.37)
    run_z_probe > current_position: (34.00, 66.00, -1.87)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (34.00, 66.00, 1.13)
    do_blocking_move_to: (34.00, 66.00, 1.13)
  Bed X: 15.000 Y: 57.000 Z: -1.872
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 66.00, 1.13)
    > do_blocking_move_to: (34.00, 66.00, 4.13)
    do_blocking_move_to: (34.00, 66.00, 4.13)
    > do_blocking_move_to: (72.00, 66.00, 4.13)
    do_blocking_move_to: (72.00, 66.00, 4.13)
    run_z_probe > current_position: (72.00, 66.00, -1.74)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (72.00, 66.00, 1.26)
    do_blocking_move_to: (72.00, 66.00, 1.26)
  Bed X: 53.000 Y: 57.000 Z: -1.743
  probe_pt >>>
    > ProbeAction:0
    > current_position: (72.00, 66.00, 1.26)
    > do_blocking_move_to: (72.00, 66.00, 4.26)
    do_blocking_move_to: (72.00, 66.00, 4.26)
    > do_blocking_move_to: (110.00, 66.00, 4.26)
    do_blocking_move_to: (110.00, 66.00, 4.26)
    run_z_probe > current_position: (110.00, 66.00, -1.69)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (110.00, 66.00, 1.31)
    do_blocking_move_to: (110.00, 66.00, 1.31)
  Bed X: 91.000 Y: 57.000 Z: -1.686
  probe_pt >>>
    > ProbeAction:0
    > current_position: (110.00, 66.00, 1.31)
    > do_blocking_move_to: (110.00, 66.00, 4.31)
    do_blocking_move_to: (110.00, 66.00, 4.31)
    > do_blocking_move_to: (148.00, 66.00, 4.31)
    do_blocking_move_to: (148.00, 66.00, 4.31)
    run_z_probe > current_position: (148.00, 66.00, -1.70)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (148.00, 66.00, 1.30)
    do_blocking_move_to: (148.00, 66.00, 1.30)
  Bed X: 129.000 Y: 57.000 Z: -1.702
  probe_pt >>>
    > ProbeAction:0
    > current_position: (148.00, 66.00, 1.30)
    > do_blocking_move_to: (148.00, 66.00, 4.30)
    do_blocking_move_to: (148.00, 66.00, 4.30)
    > do_blocking_move_to: (186.00, 66.00, 4.30)
    do_blocking_move_to: (186.00, 66.00, 4.30)
    run_z_probe > current_position: (186.00, 66.00, -1.68)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (186.00, 66.00, 1.32)
    do_blocking_move_to: (186.00, 66.00, 1.32)
  Bed X: 167.000 Y: 57.000 Z: -1.676
  probe_pt >>>
    > ProbeAction:0
    > current_position: (186.00, 66.00, 1.32)
    > do_blocking_move_to: (186.00, 66.00, 4.32)
    do_blocking_move_to: (186.00, 66.00, 4.32)
    > do_blocking_move_to: (34.00, 103.00, 4.32)
    do_blocking_move_to: (34.00, 103.00, 4.32)
    run_z_probe > current_position: (34.00, 103.00, -1.82)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (34.00, 103.00, 1.18)
    do_blocking_move_to: (34.00, 103.00, 1.18)
  Bed X: 15.000 Y: 94.000 Z: -1.821
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 103.00, 1.18)
    > do_blocking_move_to: (34.00, 103.00, 4.18)
    do_blocking_move_to: (34.00, 103.00, 4.18)
    > do_blocking_move_to: (72.00, 103.00, 4.18)
    do_blocking_move_to: (72.00, 103.00, 4.18)
    run_z_probe > current_position: (72.00, 103.00, -1.74)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (72.00, 103.00, 1.26)
    do_blocking_move_to: (72.00, 103.00, 1.26)
  Bed X: 53.000 Y: 94.000 Z: -1.742
  probe_pt >>>
    > ProbeAction:0
    > current_position: (72.00, 103.00, 1.26)
    > do_blocking_move_to: (72.00, 103.00, 4.26)
    do_blocking_move_to: (72.00, 103.00, 4.26)
    > do_blocking_move_to: (110.00, 103.00, 4.26)
    do_blocking_move_to: (110.00, 103.00, 4.26)
    run_z_probe > current_position: (110.00, 103.00, -1.66)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (110.00, 103.00, 1.34)
    do_blocking_move_to: (110.00, 103.00, 1.34)
  Bed X: 91.000 Y: 94.000 Z: -1.663
  probe_pt >>>
    > ProbeAction:0
    > current_position: (110.00, 103.00, 1.34)
    > do_blocking_move_to: (110.00, 103.00, 4.34)
    do_blocking_move_to: (110.00, 103.00, 4.34)
    > do_blocking_move_to: (148.00, 103.00, 4.34)
    do_blocking_move_to: (148.00, 103.00, 4.34)
    run_z_probe > current_position: (148.00, 103.00, -1.72)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (148.00, 103.00, 1.28)
    do_blocking_move_to: (148.00, 103.00, 1.28)
  Bed X: 129.000 Y: 94.000 Z: -1.718
  probe_pt >>>
    > ProbeAction:0
    > current_position: (148.00, 103.00, 1.28)
    > do_blocking_move_to: (148.00, 103.00, 4.28)
    do_blocking_move_to: (148.00, 103.00, 4.28)
    > do_blocking_move_to: (186.00, 103.00, 4.28)
    do_blocking_move_to: (186.00, 103.00, 4.28)
    run_z_probe > current_position: (186.00, 103.00, -1.65)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (186.00, 103.00, 1.35)
    do_blocking_move_to: (186.00, 103.00, 1.35)
  Bed X: 167.000 Y: 94.000 Z: -1.652
  probe_pt >>>
    > ProbeAction:0
    > current_position: (186.00, 103.00, 1.35)
    > do_blocking_move_to: (186.00, 103.00, 4.35)
    do_blocking_move_to: (186.00, 103.00, 4.35)
    > do_blocking_move_to: (34.00, 140.00, 4.35)
    do_blocking_move_to: (34.00, 140.00, 4.35)
    run_z_probe > current_position: (34.00, 140.00, -1.83)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (34.00, 140.00, 1.17)
    do_blocking_move_to: (34.00, 140.00, 1.17)
  Bed X: 15.000 Y: 131.000 Z: -1.830
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 140.00, 1.17)
    > do_blocking_move_to: (34.00, 140.00, 4.17)
    do_blocking_move_to: (34.00, 140.00, 4.17)
    > do_blocking_move_to: (72.00, 140.00, 4.17)
    do_blocking_move_to: (72.00, 140.00, 4.17)
    run_z_probe > current_position: (72.00, 140.00, -1.73)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (72.00, 140.00, 1.27)
    do_blocking_move_to: (72.00, 140.00, 1.27)
  Bed X: 53.000 Y: 131.000 Z: -1.727
  probe_pt >>>
    > ProbeAction:0
    > current_position: (72.00, 140.00, 1.27)
    > do_blocking_move_to: (72.00, 140.00, 4.27)
    do_blocking_move_to: (72.00, 140.00, 4.27)
    > do_blocking_move_to: (110.00, 140.00, 4.27)
    do_blocking_move_to: (110.00, 140.00, 4.27)
    run_z_probe > current_position: (110.00, 140.00, -1.67)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (110.00, 140.00, 1.33)
    do_blocking_move_to: (110.00, 140.00, 1.33)
  Bed X: 91.000 Y: 131.000 Z: -1.669
  probe_pt >>>
    > ProbeAction:0
    > current_position: (110.00, 140.00, 1.33)
    > do_blocking_move_to: (110.00, 140.00, 4.33)
    do_blocking_move_to: (110.00, 140.00, 4.33)
    > do_blocking_move_to: (148.00, 140.00, 4.33)
    do_blocking_move_to: (148.00, 140.00, 4.33)
    run_z_probe > current_position: (148.00, 140.00, -1.64)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (148.00, 140.00, 1.36)
    do_blocking_move_to: (148.00, 140.00, 1.36)
  Bed X: 129.000 Y: 131.000 Z: -1.644
  probe_pt >>>
    > ProbeAction:0
    > current_position: (148.00, 140.00, 1.36)
    > do_blocking_move_to: (148.00, 140.00, 4.36)
    do_blocking_move_to: (148.00, 140.00, 4.36)
    > do_blocking_move_to: (186.00, 140.00, 4.36)
    do_blocking_move_to: (186.00, 140.00, 4.36)
    run_z_probe > current_position: (186.00, 140.00, -1.66)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (186.00, 140.00, 1.34)
    do_blocking_move_to: (186.00, 140.00, 1.34)
  Bed X: 167.000 Y: 131.000 Z: -1.656
  probe_pt >>>
    > ProbeAction:0
    > current_position: (186.00, 140.00, 1.34)
    > do_blocking_move_to: (186.00, 140.00, 4.34)
    do_blocking_move_to: (186.00, 140.00, 4.34)
    > do_blocking_move_to: (34.00, 177.00, 4.34)
    do_blocking_move_to: (34.00, 177.00, 4.34)
    run_z_probe > current_position: (34.00, 177.00, -1.78)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (34.00, 177.00, 1.22)
    do_blocking_move_to: (34.00, 177.00, 1.22)
  Bed X: 15.000 Y: 168.000 Z: -1.776
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 177.00, 1.22)
    > do_blocking_move_to: (34.00, 177.00, 4.22)
    do_blocking_move_to: (34.00, 177.00, 4.22)
    > do_blocking_move_to: (72.00, 177.00, 4.22)
    do_blocking_move_to: (72.00, 177.00, 4.22)
    run_z_probe > current_position: (72.00, 177.00, -1.69)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (72.00, 177.00, 1.31)
    do_blocking_move_to: (72.00, 177.00, 1.31)
  Bed X: 53.000 Y: 168.000 Z: -1.686
  probe_pt >>>
    > ProbeAction:0
    > current_position: (72.00, 177.00, 1.31)
    > do_blocking_move_to: (72.00, 177.00, 4.31)
    do_blocking_move_to: (72.00, 177.00, 4.31)
    > do_blocking_move_to: (110.00, 177.00, 4.31)
    do_blocking_move_to: (110.00, 177.00, 4.31)
    run_z_probe > current_position: (110.00, 177.00, -1.66)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (110.00, 177.00, 1.34)
    do_blocking_move_to: (110.00, 177.00, 1.34)
  Bed X: 91.000 Y: 168.000 Z: -1.660
  probe_pt >>>
    > ProbeAction:0
    > current_position: (110.00, 177.00, 1.34)
    > do_blocking_move_to: (110.00, 177.00, 4.34)
    do_blocking_move_to: (110.00, 177.00, 4.34)
    > do_blocking_move_to: (148.00, 177.00, 4.34)
    do_blocking_move_to: (148.00, 177.00, 4.34)
    run_z_probe > current_position: (148.00, 177.00, -1.70)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (148.00, 177.00, 1.30)
    do_blocking_move_to: (148.00, 177.00, 1.30)
  Bed X: 129.000 Y: 168.000 Z: -1.697
  probe_pt >>>
    > ProbeAction:2
    > current_position: (148.00, 177.00, 1.30)
    > do_blocking_move_to: (148.00, 177.00, 4.30)
    do_blocking_move_to: (148.00, 177.00, 4.30)
    > do_blocking_move_to: (186.00, 177.00, 4.30)
    do_blocking_move_to: (186.00, 177.00, 4.30)
    run_z_probe > current_position: (186.00, 177.00, -1.63)
    > ProbeStow
    stow_z_probe > current_position: (186.00, 177.00, -1.63)
    do_blocking_move_to: (186.00, 177.00, 6.37)
  Bed X: 167.000 Y: 168.000 Z: -1.633
  > probing complete > current_position: (186.00, 177.00, 6.37)
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
  Eqn coefficients: a: 0.00092500 b: -0.00010216 d: -1.77602157
  Mean of sampled points: -1.70145025

  Bed Height Topography:
  +-----------+
  |...Back....|
  |Left..Right|
  |...Front...|
  +-----------+
  -0.07505 +0.01545 +0.04170 +0.00445 +0.06870
  -0.12830 -0.02580 +0.03195 +0.05695 +0.04495
  -0.11930 -0.04055 +0.03895 -0.01655 +0.04895
  -0.17055 -0.04205 +0.01570 -0.00055 +0.02520
  -0.03905 +0.03745 +0.08145 +0.07420 +0.07170
  planeNormal x: -0.000925 y: 0.000102 z: 1.000000
  set_bed_level_equation_lsq > current_position: (186.01, 177.00, 6.21)

  Bed Level Correction Matrix:
  +1.000000 +0.000000 +0.000925
  +0.000000 +1.000000 -0.000102
  -0.000925 +0.000102 +1.000000
<<< gcode_G29
N221 G29 P2 V4 *51
gcode_G29 >>>
  Home X/Y before Z
N226 G28 X0 Y0 *52
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 177.00, 6.20)
  > homeX: (0.00, 177.00, 6.20)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 6.20)
  > homeY: (0.00, 0.00, 6.20)
  > Set X: (0.00, 0.00, 6.20)
  > Set Y: (0.00, 0.00, 6.20)
  > Z_SAFE_HOMING >>>
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
N241 G29 P2 V4 *53
gcode_G29 >>>
  G29 Auto Bed Leveling
  enable_endstops(true)
  probe_pt >>>
    > ProbeAction:1
    > current_position: (0.00, 0.00, 6.20)
    > do_blocking_move_to: (0.00, 0.00, 8.00)
    do_blocking_move_to: (0.00, 0.00, 8.00)
    > do_blocking_move_to: (34.00, 29.00, 8.00)
    do_blocking_move_to: (34.00, 29.00, 8.00)
    > ProbeDeploy
    deploy_z_probe > current_position: (34.00, 29.00, 8.00)
    run_z_probe > current_position: (34.00, 29.00, -1.97)
  Bed X: 15.000 Y: 20.000 Z: -1.969
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 29.00, -1.97)
    > do_blocking_move_to: (34.00, 29.00, 1.03)
    do_blocking_move_to: (34.00, 29.00, 1.03)
    > do_blocking_move_to: (189.00, 29.00, 1.03)
    do_blocking_move_to: (189.00, 29.00, 1.03)
    run_z_probe > current_position: (189.00, 29.00, -1.83)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (189.00, 29.00, 1.17)
    do_blocking_move_to: (189.00, 29.00, 1.17)
  Bed X: 170.000 Y: 20.000 Z: -1.830
  probe_pt >>>
    > ProbeAction:0
    > current_position: (189.00, 29.00, 1.17)
    > do_blocking_move_to: (189.00, 29.00, 4.17)
    do_blocking_move_to: (189.00, 29.00, 4.17)
    > do_blocking_move_to: (34.00, 179.00, 4.17)
    do_blocking_move_to: (34.00, 179.00, 4.17)
    run_z_probe > current_position: (34.00, 179.00, -2.00)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (34.00, 179.00, 1.00)
    do_blocking_move_to: (34.00, 179.00, 1.00)
  Bed X: 15.000 Y: 170.000 Z: -1.996
  probe_pt >>>
    > ProbeAction:2
    > current_position: (34.00, 179.00, 1.00)
    > do_blocking_move_to: (34.00, 179.00, 4.00)
    do_blocking_move_to: (34.00, 179.00, 4.00)
    > do_blocking_move_to: (189.00, 179.00, 4.00)
    do_blocking_move_to: (189.00, 179.00, 4.00)
    run_z_probe > current_position: (189.00, 179.00, -1.81)
    > ProbeStow
    stow_z_probe > current_position: (189.00, 179.00, -1.81)
    do_blocking_move_to: (189.00, 179.00, 6.19)
  Bed X: 170.000 Y: 170.000 Z: -1.810
  > probing complete > current_position: (189.00, 179.00, 6.19)
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
  Eqn coefficients: a: 0.00104839 b: -0.00002500 d: -1.99610080
  Mean of sampled points: -1.90150012

  Bed Height Topography:
  +-----------+
  |...Back....|
  |Left..Right|
  |...Front...|
  +-----------+
  -0.09475 +0.09100
  -0.06775 +0.07150
  planeNormal x: -0.001048 y: 0.000025 z: 1.000000
  set_bed_level_equation_lsq > current_position: (189.01, 179.00, 6.00)

  Bed Level Correction Matrix:
  +1.000000 +0.000000 +0.001048
  +0.000000 +1.000000 -0.000025
  -0.001048 +0.000025 +1.000000
<<< gcode_G29
N260 G28 X0 Y0 *54
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 179.00, 5.98)
  > homeX: (0.00, 179.00, 5.98)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 5.98)
  > homeY: (0.00, 0.00, 5.98)
  > Set X: (0.00, 0.00, 5.98)
  > Set Y: (0.00, 0.00, 5.98)
  > Z_SAFE_HOMING >>>
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
N275 G29 P2 *112
gcode_G29 >>>
  G29 Auto Bed Leveling
  enable_endstops(true)
  probe_pt >>>
    > ProbeAction:1
    > current_position: (0.00, 0.00, 5.98)
    > do_blocking_move_to: (0.00, 0.00, 8.00)
    do_blocking_move_to: (0.00, 0.00, 8.00)
    > do_blocking_move_to: (34.00, 29.00, 8.00)
    do_blocking_move_to: (34.00, 29.00, 8.00)
    > ProbeDeploy
    deploy_z_probe > current_position: (34.00, 29.00, 8.00)
    run_z_probe > current_position: (34.00, 29.00, -2.18)
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 29.00, -2.18)
    > do_blocking_move_to: (34.00, 29.00, 0.82)
    do_blocking_move_to: (34.00, 29.00, 0.82)
    > do_blocking_move_to: (189.00, 29.00, 0.82)
    do_blocking_move_to: (189.00, 29.00, 0.82)
    run_z_probe > current_position: (189.00, 29.00, -2.04)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (189.00, 29.00, 0.96)
    do_blocking_move_to: (189.00, 29.00, 0.96)
  probe_pt >>>
    > ProbeAction:0
    > current_position: (189.00, 29.00, 0.96)
    > do_blocking_move_to: (189.00, 29.00, 3.96)
    do_blocking_move_to: (189.00, 29.00, 3.96)
    > do_blocking_move_to: (189.00, 179.00, 3.96)
    do_blocking_move_to: (189.00, 179.00, 3.96)
    run_z_probe > current_position: (189.00, 179.00, -2.02)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (189.00, 179.00, 0.98)
    do_blocking_move_to: (189.00, 179.00, 0.98)
  probe_pt >>>
    > ProbeAction:2
    > current_position: (189.00, 179.00, 0.98)
    > do_blocking_move_to: (189.00, 179.00, 3.98)
    do_blocking_move_to: (189.00, 179.00, 3.98)
    > do_blocking_move_to: (34.00, 179.00, 3.98)
    do_blocking_move_to: (34.00, 179.00, 3.98)
    run_z_probe > current_position: (34.00, 179.00, -2.16)
    > ProbeStow
    stow_z_probe > current_position: (34.00, 179.00, -2.16)
    do_blocking_move_to: (34.00, 179.00, 5.84)
  > probing complete > current_position: (34.00, 179.00, 5.84)
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
  Eqn coefficients: a: 0.00092258 b: 0.00011167 d: -2.19819712
  planeNormal x: -0.000923 y: -0.000112 z: 1.000000
  set_bed_level_equation_lsq > current_position: (34.01, 179.00, 5.78)

  Bed Level Correction Matrix:
  +1.000000 +0.000000 +0.000923
  -0.000000 +1.000000 +0.000112
  -0.000923 -0.000112 +1.000000
<<< gcode_G29
N295 G28 *61
gcode_G28 >>>
  home_axis with axis=0
  home_axis > current_position: (0.00, 179.00, 5.77)
  > homeX: (0.00, 179.00, 5.77)
  home_axis with axis=1
  home_axis > current_position: (0.00, 0.00, 5.77)
  > homeY: (0.00, 0.00, 5.77)
  > Z_SAFE_HOMING >>>
    > home_all_axis > destination: (114.00, 104.00, 6.00)
    deploy_z_probe > current_position: (114.00, 104.00, 0.00)
    home_axis with axis=2
    home_axis > current_position: (114.00, 104.00, 0.00)
    home_axis > SERVO_ENDSTOPS > Stow with write()
    home_axis(Z_AXIS) > SERVO_LEVELING > stow_z_probe
    stow_z_probe > current_position: (114.00, 104.00, 0.00)
    do_blocking_move_to: (114.00, 104.00, 8.00)
    > home_all_axis > final: (114.00, 104.00, 8.00)
  <<< Z_SAFE_HOMING
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
N306 G29 P2 *117
gcode_G29 >>>
  G29 Auto Bed Leveling
  enable_endstops(true)
  probe_pt >>>
    > ProbeAction:1
    > current_position: (114.00, 104.00, 10.33)
    > do_blocking_move_to: (114.00, 104.00, 8.00)
    do_blocking_move_to: (114.00, 104.00, 8.00)
    > do_blocking_move_to: (34.00, 29.00, 8.00)
    do_blocking_move_to: (34.00, 29.00, 8.00)
    > ProbeDeploy
    deploy_z_probe > current_position: (34.00, 29.00, 8.00)
    run_z_probe > current_position: (34.00, 29.00, -1.82)
  probe_pt >>>
    > ProbeAction:0
    > current_position: (34.00, 29.00, -1.82)
    > do_blocking_move_to: (34.00, 29.00, 1.18)
    do_blocking_move_to: (34.00, 29.00, 1.18)
    > do_blocking_move_to: (189.00, 29.00, 1.18)
    do_blocking_move_to: (189.00, 29.00, 1.18)
    run_z_probe > current_position: (189.00, 29.00, -1.65)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (189.00, 29.00, 1.35)
    do_blocking_move_to: (189.00, 29.00, 1.35)
  probe_pt >>>
    > ProbeAction:0
    > current_position: (189.00, 29.00, 1.35)
    > do_blocking_move_to: (189.00, 29.00, 4.35)
    do_blocking_move_to: (189.00, 29.00, 4.35)
    > do_blocking_move_to: (189.00, 179.00, 4.35)
    do_blocking_move_to: (189.00, 179.00, 4.35)
    run_z_probe > current_position: (189.00, 179.00, -1.64)
    Raise Z by 3
    > ProbeStay > do_blocking_move_to: (189.00, 179.00, 1.36)
    do_blocking_move_to: (189.00, 179.00, 1.36)
  probe_pt >>>
    > ProbeAction:2
    > current_position: (189.00, 179.00, 1.36)
    > do_blocking_move_to: (189.00, 179.00, 4.36)
    do_blocking_move_to: (189.00, 179.00, 4.36)
    > do_blocking_move_to: (34.00, 179.00, 4.36)
    do_blocking_move_to: (34.00, 179.00, 4.36)
    run_z_probe > current_position: (34.00, 179.00, -1.82)
    > ProbeStow
    stow_z_probe > current_position: (34.00, 179.00, -1.82)
    do_blocking_move_to: (34.00, 179.00, 6.19)
  > probing complete > current_position: (34.00, 179.00, 6.19)
  ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
  Eqn coefficients: a: 0.00110806 b: 0.00007667 d: -1.84227933
  planeNormal x: -0.001108 y: -0.000077 z: 1.000000
  set_bed_level_equation_lsq > current_position: (34.01, 179.00, 6.13)

  Bed Level Correction Matrix:
  +0.999999 +0.000000 +0.001108
  -0.000000 +1.000000 +0.000077
  -0.001108 -0.000077 +0.999999
<<< gcode_G29
Wurstnase commented 9 years ago

Here is my debug: https://gist.github.com/Wurstnase/da62ee63ae2a02ca3aee

thinkyhead commented 9 years ago

Thanks all, a lot to read through! I hope to make sense of it all soon...

lrpirlet commented 9 years ago

OK, I verified my idea... I think I have something new.

The ONLY change I made from yesterday testing was to change in Configuration_adv.h file #define Z_HOME_BUMP_MM from 2 to 3... So I compiled with #define Z_HOME_BUMP_MM 3… The distance from the bed is now 6 mm... In fact, I measured 5.98mm made of a stack of paper, I guess it is close enough...

As I understand it, the issue is somewhere in the HOMEAXIS routine... In fact, this parameter is only multiplied by 2 here in Marlin_main.cpp line 1168

  // move back down slowly to find bed
  set_homing_bump_feedrate(Z_AXIS);

zPosition -= home_bump_mm(Z_AXIS) * 2; line_to_z(zPosition); st_synchronize(); endstops_hit_on_purpose(); // clear endstop hit flags

  current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);

Now, as I said, I am not quite a programmer, and I just do not fully understand this routine... I guess we are closer.

However, just to correct that without understanding why we get the head bellow the bed could lead to some crash... I have to remember using a cardboard on the bed and kill the printer if the head tries to punch a hole... :-)

thinkyhead commented 9 years ago

That is a very important setting – Z_HOME_BUMP_MM. I started out with it too low on my machine, and quickly figured out to set it higher - in my case 2mm was enough - but 2.5 or 3 may be better for probes. It was hidden in the advanced configuration, which made it easy to overlook. We might want to promote it to the main Configuration.h.

Or, better – get rid of the setting and just have Z move up until the Z endstop state changes, then move 0.5mm-1mm extra.

Anyway: about to read through some of these logs an annotate them.

thinkyhead commented 9 years ago

I've added new logging of all the Z raise values during homing and probing, and made the output slightly cleaner. Clear the browser cache and re-download: https://github.com/thinkyhead/Marlin/archive/debug_G29.zip

thinkyhead commented 9 years ago

I'm thinking, similar to the way the manual bed leveling works in a step-by-step fashion, there should be a GCode to probe a point on the bed. The point probed is added to an array of a fixed length. When enough points have been probed, you send another GCode that applies the probed points to a bed leveling matrix. Or, applies the most recent probe to the Z homing position. Breaking it up like this could simplify processes like this a lot, and make these simple tricks exposable to the outside in a simple fashion.

M670: Push a point onto the end of the circular probe array. Examples:
  M670         - Probe the Z position at the current XY, push XYZ
  M670 T       - Push the current (known) XYZ (for manual bed leveling)
  M670 X20 Y20 - Probe Z at X20 Y20
  M670 X100    - Probe Z at X100, current Y
  M670 Z0      - Probe Z at the current XY and make the probed position Z=0
  M670 D1      - Measure the distance between two endstops/probes (Axis index 1 = Y)

M671: Probe several points in different ways
  M671         - Probe using the default number of points
  M671 P9      - Probe using a 3x3 matrix
  M671 P16     - Probe using a 4x4 matrix
  M671 R50     - Probe a circular radius of 50mm

M672: Apply a leveling (compensation) matrix
  M672         - Generate a leveling matrix from recorded points with default (only?) method.
  M672 S0      - Turn off the leveling matrix (currently happens on homing)
  M672 S1      - Turn on the leveling matrix, if one exists
  M672 P3      - Generate a leveling matrix using the last 3 points (triangle)
  M672 P4      - Generate a leveling matrix using the last 4 points (square)
  M672 P9      - Generate a leveling matrix using the last 3x3 points (matrix)
  M672 T2 P3   - Generate matrix by averaging two triangles (for example)
lrpirlet commented 9 years ago

@thinkyhead, Very nice idea, this new set of m code could be used as a Library to build for example a new G29 with lots and lots of possibilities (and parameters)... A new G29 that would "make" the bed parallel to the X-Y plan (bed leveling as per common naming)... we could then supperpose Mesh leveling to help addesion for a not quite so constant distance between a bed point and a X-Y surface that should be a plan but that is not... the mesh could then be pushed in eeprom once for ever because would be applied to a bed parallel to the X-Y axis. We could even have a additional m code to generate the huge MESH map..

More, all that would be a lot easier to maintain... one code, one function.

Maybe a new feature? Hopefully we will not need that to solve this bug :-(

I have downloaded the new zip. in a couple of hours, I'll compile, test and report :-)

Thanks to take care, anyway