|
@@ -47,18 +47,16 @@
|
47
|
47
|
* as possible to determine if this is the case. If this move is within the same cell, we will
|
48
|
48
|
* just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave
|
49
|
49
|
*/
|
50
|
|
- const float start[XYZE] = {
|
51
|
|
- current_position[X_AXIS],
|
52
|
|
- current_position[Y_AXIS],
|
53
|
|
- current_position[Z_AXIS],
|
54
|
|
- current_position[E_AXIS]
|
55
|
|
- },
|
56
|
|
- end[XYZE] = {
|
57
|
|
- destination[X_AXIS],
|
58
|
|
- destination[Y_AXIS],
|
59
|
|
- destination[Z_AXIS],
|
60
|
|
- destination[E_AXIS]
|
61
|
|
- };
|
|
50
|
+ #if ENABLED(SKEW_CORRECTION)
|
|
51
|
+ // For skew correction just adjust the destination point and we're done
|
|
52
|
+ float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] },
|
|
53
|
+ end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] };
|
|
54
|
+ planner.skew(start[X_AXIS], start[Y_AXIS], start[Z_AXIS]);
|
|
55
|
+ planner.skew(end[X_AXIS], end[Y_AXIS], end[Z_AXIS]);
|
|
56
|
+ #else
|
|
57
|
+ const float (&start)[XYZE] = current_position,
|
|
58
|
+ (&end)[XYZE] = destination;
|
|
59
|
+ #endif
|
62
|
60
|
|
63
|
61
|
const int cell_start_xi = get_cell_index_x(start[X_AXIS]),
|
64
|
62
|
cell_start_yi = get_cell_index_y(start[Y_AXIS]),
|
|
@@ -66,10 +64,10 @@
|
66
|
64
|
cell_dest_yi = get_cell_index_y(end[Y_AXIS]);
|
67
|
65
|
|
68
|
66
|
if (g26_debug_flag) {
|
69
|
|
- SERIAL_ECHOPAIR(" ubl.line_to_destination(xe=", end[X_AXIS]);
|
70
|
|
- SERIAL_ECHOPAIR(", ye=", end[Y_AXIS]);
|
71
|
|
- SERIAL_ECHOPAIR(", ze=", end[Z_AXIS]);
|
72
|
|
- SERIAL_ECHOPAIR(", ee=", end[E_AXIS]);
|
|
67
|
+ SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]);
|
|
68
|
+ SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]);
|
|
69
|
+ SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]);
|
|
70
|
+ SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]);
|
73
|
71
|
SERIAL_CHAR(')');
|
74
|
72
|
SERIAL_EOL();
|
75
|
73
|
debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()"));
|
|
@@ -416,12 +414,19 @@
|
416
|
414
|
// We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
|
417
|
415
|
// so we call buffer_segment directly here. Per-segmented leveling and kinematics performed first.
|
418
|
416
|
|
419
|
|
- inline void _O2 ubl_buffer_segment_raw(const float (&raw)[XYZE], const float &fr) {
|
|
417
|
+ inline void _O2 ubl_buffer_segment_raw(const float (&in_raw)[XYZE], const float &fr) {
|
|
418
|
+
|
|
419
|
+ #if ENABLED(SKEW_CORRECTION)
|
|
420
|
+ float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS] };
|
|
421
|
+ planner.skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]);
|
|
422
|
+ #else
|
|
423
|
+ const float (&raw)[XYZE] = in_raw;
|
|
424
|
+ #endif
|
420
|
425
|
|
421
|
426
|
#if ENABLED(DELTA) // apply delta inverse_kinematics
|
422
|
427
|
|
423
|
428
|
DELTA_RAW_IK();
|
424
|
|
- planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
|
|
429
|
+ planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder);
|
425
|
430
|
|
426
|
431
|
#elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
|
427
|
432
|
|
|
@@ -434,11 +439,11 @@
|
434
|
439
|
scara_oldB = delta[B_AXIS];
|
435
|
440
|
float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
|
436
|
441
|
|
437
|
|
- planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
|
|
442
|
+ planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], s_feedrate, active_extruder);
|
438
|
443
|
|
439
|
444
|
#else // CARTESIAN
|
440
|
445
|
|
441
|
|
- planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
|
|
446
|
+ planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_AXIS], fr, active_extruder);
|
442
|
447
|
|
443
|
448
|
#endif
|
444
|
449
|
}
|
|
@@ -461,7 +466,7 @@
|
461
|
466
|
* Returns true if did NOT move, false if moved (requires current_position update).
|
462
|
467
|
*/
|
463
|
468
|
|
464
|
|
- bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float rtarget[XYZE], const float &feedrate) {
|
|
469
|
+ bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate) {
|
465
|
470
|
|
466
|
471
|
if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) // fail if moving outside reachable boundary
|
467
|
472
|
return true; // did not move, so current_position still accurate
|