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.16k stars 19.21k forks source link

ABL on Delta starts at x0 y0 (instead of at edge of bed) and slants #4206

Closed alitai closed 8 years ago

alitai commented 8 years ago

Hi - Still working on getting the BugFix version to work. Downloaded a new RCBugFix branch today and am getting an issue with the ABL functionality. The probing starts in the center (X0 Y0) and moves to the rear right quadrant, and does so at a slant.

I am using the Zmin pin and the nozzle as a probe (with a Trinket Based FSR detector), so offsets are all '0'.

Thanks,

Assaf

Bed Leveling Configuration ``` cpp // @section bedlevel #define AUTO_BED_LEVELING_FEATURE // Delete the comment to enable (remove // at the start of the line) //#define DEBUG_LEVELING_FEATURE #if ENABLED(AUTO_BED_LEVELING_FEATURE) // There are 2 different ways to specify probing locations: // // - "grid" mode // Probe several points in a rectangular grid. // You specify the rectangle and the density of sample points. // This mode is preferred because there are more measurements. // // - "3-point" mode // Probe 3 arbitrary points on the bed (that aren't collinear) // You specify the XY coordinates of all 3 points. // Enable this to sample the bed in a grid (least squares solution). // Note: this feature generates 10KB extra code size. #define AUTO_BED_LEVELING_GRID // Deltas only support grid mode. #if ENABLED(AUTO_BED_LEVELING_GRID) // Set the rectangle in which to probe #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) #define BACK_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS ```
alitai commented 8 years ago

@anhardt figured it out - the effector is trying to move to the initial point while still homed. So the carriages hit the endpoints. A move to point X:31.00 Y:-49.00 Z:243.70 E:0.00 Count X: 86168 Y:86248 Z:85995 remains at X:0 Y:0....

In the past, the effector used to go down prior to probing. Is that settable in configuration.h?

There is a workaround for now - running: G28 G0 Z100 G29

works, and completes a full G29 cycle.

Thank you @AnHardt, @thinkyhead, @Roxy-3D and @Blue-Marlin for all your help - you guys are awesome.

alitai commented 8 years ago

Should I close this issue - or should we close it only after the issue is resolved in code (or configuration)?

alitai commented 8 years ago

@anhardt - I apologize again - You had asked about this before–

For a test we could ask for adding an endstop_adj of a few mm to all axes to free the endstops before another move can happen. Or we could simply try:

G28
G91
G0 Z-10
G90
G29

Only now do I see what you meant - when the effector tries to get to the coordinates it does hit the endstops. you were on to the problem 4 days ago...

thinkyhead commented 8 years ago

the effector used to go down prior to probing

Yes, this was recently (unintentionally) changed. It was assumed that the initial height (Z_RAISE_BEFORE_PROBING) was purely for probe deployment, and that movement to the first XY point would occur afterward, or at least the Z move would occur before the XY move.

Clearly on a DELTA the initial "raise" still needs to be applied even if it is lower. The do_blocking_move_to function doesn't help delta probing, unfortunately, because it only avoids XY moves before Z moves when raising Z. Perhaps we should make the Z move logic in do_blocking_move_to the point of exception for DELTA. (Always move Z before XY with DELTA).

thinkyhead commented 8 years ago

4303 is almost the right idea, but....

Background: I believe the upper part of a delta's total build volume is actually a cone, so the full volume looks like a pointy rocket. Marlin currently supports making full use of that limited upper-region of the build area, as long as you don't try to move any of the carriages beyond their upper limit. So you can print a taller Chrysler Building than a cylinder.

That said (and apropos of the corporate engineering lab) I think it's good to place safety margins. But… I think enforcing a fixed height based on where the nozzle can reach the outer edge is probably too strict.

Compare to software endstops on a nice square Cartesian. They are easy to enforce, but ultimately meaningless on a delta. Instead with a delta we have to constrain based on the radius (fortunately no sqrt is required for the test phase). We can account for the upper conical region, which starts at the full radius at the safe-distance figured in #4303, and descends linearly to a single point at the Z_MAX position). Then when "clamping", we move the nozzle towards the center (also linear - no need for sin/cos).

static float get max_cylinder_z() { . . . } // highest Z with usable full radius

/**
 * Like clamp_to_software_endstops, but for delta moves.
 * Alters the xyz before use so hi and lo level axes are in sync.
 * Constrain totally screws up your print in progress, so slice with care!
 */
void clamp_to_delta_volume(float &xyz[NUM_AXIS]) {
  static float max_cylinder_z = get_max_cylinder_z(); // can rod trim change this?
  float max_radius = delta_radius; // the full usable radius
  // above the max cylinder z? (only needs recalculation as Z changes)
  if (xyz[Z_AXIS] > max_cylinder_z) {
    // proportion at Z [e.g., 1-(110-100)/(150-100)==1-1/5==0.8]
    max_radius *= 1.0 - (xyz[Z_AXIS] - max_cylinder_z) / (Z_MAX_POS - max_cylinder_z);
  }
  // point outside the radius?
  float r2 = sq(xyz[X_AXIS] - CENTER_X) + sq(xyz[Y_AXIS] - CENTER_Y);
  if (r2 > sq(max_radius)) {
    float prop = sqrt(r2) / max_radius;
    xyz[X_AXIS] = CENTER_X + (xyz[X_AXIS] - CENTER_X) * prop;
    xyz[Y_AXIS] = CENTER_Y + (xyz[Y_AXIS] - CENTER_Y) * prop;
  }
}
jbrazio commented 8 years ago

@thinkyhead since #4303 is merged, can we close this ?

alitai commented 8 years ago

RC7 works really well on my Mini Kossel G28 followed by G29 work without hitting the endstops - Thank you all for the excellent work!

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.